[BUG][FIX][TEST] Morph adding/removing

Andreas Raab andreas.raab at gmx.de
Sun Aug 10 17:01:29 UTC 2003


Hi,

The attached CS fixes various issues with Morph adding and removing the
appropriate notifications. The attached test (which needs to go on top of
the base image tests) illustrates the problem. The CS is slightly more
complex than I liked but there simply wasn't another way of fixing that
problem. As it turns out, the lack of a public #removeMorph: protocol leaves
clients with all sorts of assumptions "what exactly is going to happen" if
they just wish to remove a morph without dumping it (as is implied with
#delete). In addition, the overrides of the privateRemoveMorph: protocols
complicate matters even further which is why they have been moved into a
separate notification protocol (#addedMorph: and #removedMorph:) which
further subsumes the #addedOrRemovedSubmorph: protocol (as this was broken
as well).

All in all, the changes can probably be seen as part of MCP as they
reformulate some notions that should have long been fixed in Morphic.

Here is the preamble of the CS:
"Change Set:		MorphRemoval-ar
Date:			10 August 2003
Author:			Andreas Raab

This change set fixes various of the issues for getting proper notifications
when adding or removing morphs. What it does:
* Morph>>removeMorph: has been added as a public method to remove a submorph
from some parent (why wasn't this there before???).
* Morph>>privateRemove: just removes the morph from its submorphs and is NOT
intended for casual use (that's what we have #removeMorph: for).
* Morph>>addedMorph: and Morph>>removedMorph: have been introduced for
clients which need to know about adding/removing morphs
* Morph>>addAll: and friends have been updated to adhere to the new
protocols while preserving their optimized implementations.
* Various places have been fixed to use #removeMorph: instead of
#privateRemoveMorph: and to implement the #removedMorph: notification.
* #privateRemoveMorph: as well as #addedOrRemovedSubmorph: have been
deprecated.
"

Cheers,
  - Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MorphRemoval-ar.2.cs
Type: application/octet-stream
Size: 13255 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030810/7d8a5366/MorphRemoval-ar.2.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MorphTest-testIntoWorldTransferToNewGuy.st
Type: application/octet-stream
Size: 1572 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030810/7d8a5366/MorphTest-testIntoWorldTransferToNewGuy.obj


More information about the Squeak-dev mailing list