[self-interest] Propogating slot changes in Morphs

Randy randy.smith at gmail.com
Fri Apr 16 02:05:23 UTC 2010

On Apr 15, 2010, at 6:42 PM, Chris Double wrote:

> When doing the scrolling changes in my image I added a slot to 
> WorldMorph to hold the current point when initiating the scroll. The 
> methods in the WorldMorph traits object used this to read/write and do 
> scrolling.
> This didn't change existing WorldMorphs since they are clones of 
> WorldMorph and the data slots are actually held in the morph, not a 
> parent slot. So I manually re-added the slot in all existing 
> WorldMorph's to prevent errors when the WorldMorph trait methods were 
> called.
> Is there a way to do this automatically when adding/changing slots in a 
> Morph? What's the idiom in Self for dealing with this sort of thing?

Not that I can recall... I thin kthee is a way to gather all the children of an object, can't recall for certain: if so you could write a little script that gathers all the children of the traits, and does a  _AddSlot: ... to each.

Then make it a menu item if you like...


> Chris.
> -- 
> http://www.bluishcoder.co.nz

More information about the Self-interest mailing list