Morph>delete

Bob Arning arning at charm.net
Thu Sep 7 04:58:51 UTC 2000


On Wed, 6 Sep 2000 22:33:00 -0500 "Eric Arseneau" <eat at huv.com> wrote:
>Can someone explain to me why delete'ing a morph, does not pass this on to
>the submorphs ?  Is this an expected feature ?  The problem I ran into was
>that a submorph down in the morph tree needs to release some resources when
>it is no longer in need.  I had assume that delete would trickle down the
>morph tree, but it does not seem to.  It does disconnect itself from its
>parent, but the children are left out in the cold.

Eric,

A couple of reasons come to mind:
1. It's extra work that's rarely necessary.
2. It would make certain tasks more difficult. Presently it is possible to delete a morph and later add it somewhere (where it was originally or someplace quite different) and all the submorphs are still attached.

Possible alternatives:
- Implement the method you want with a different name (#destroy, #deleteCompletely, #deleteRecursively or somesuch). There was some discussion about this a few months ago.
- Implement some sort of registry where morphs that need post-delete notification can get it. The registry could simply check its contents periodically and inform morphs that were no longer in the world of that fact.

Cheers,
Bob





More information about the Squeak-dev mailing list