简体   繁体   English

删除所有者后如何检测子变形的移除

[英]How to detect the removal of a submorph when the owner is deleted

If I have a morph that contains submorphs, and I delete it, what messages get sent to the submorphs? 如果我有一个包含子变形的变形,并且删除了它,那么哪些消息会发送到该子变形? delete is not being sent. delete未发送。

Here is the situation. 这是情况。 I have a container Morph (not subclassed) which holds some submorphs of class MyMorph. 我有一个容器Morph(未子类化),其中包含MyMorph类的某些子变形。 After I open the container Morph in world, I close it (from the Morphic halo, or by sending it delete from an inspector. I want the MyMorphs to do something at that time. But I don't want to make a subclass just for the container Morph. (If I did that, I could just handle delete and have it send some message to each MyMorph). So, is there some message that does get sent by the Morph to each of its submorphs when handling delete ? 在世界上打开容器Morph后,我将其关闭(从Morphic光环中delete ,或从检查员中delete它。我希望MyMorphs当时可以做一些事情。但是我不想为(如果这样做的话,我可以处理delete并让它向每个MyMorph发送一些消息)。那么,在处理delete时,Morph是否有某些消息确实发送给了它的每个子变形?

Use the intoWorld: / outOfWorld: mechanism. 使用intoWorld: / outOfWorld:机制。

For an example see MorphTest>>testIntoWorldDeleteOutOfWorld (which uses TestInWorldMorph ). 有关示例,请参见MorphTest>>testIntoWorldDeleteOutOfWorld (使用TestInWorldMorph )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM