[ENH] MorphicDependents, MasterSlaveMorph

Helge Horch Helge.Horch at munich.netsurf.de
Tue May 16 01:01:44 UTC 2000


At 07:25 15.05.2000 +0200, Stephan Rudlof wrote:
>Change Set:             MorphicDependents
>[...]
>Introduces a dependency mechanism for Morphs.
>Main goal was to have an update mechanism for dependent morphs of a
>moved one, mainly by dragging it with the hand.
>
>[...]
>Note:
>Only BorderedMorphs are subclasses of MorphWithDependents, which has an
>inst var for dependents; so for other morphs clean up of dependents
>(breakDependents) has to be made manually.
>
>Enhancements:
>Currently only Morph>>position:, >>color: and >>delete: send update
>messages. Other messages could be changed similarly."

Couldn't we just use/enhance/broaden the currently present dependency 
mechanism (via MorphExtension's EventHandler)?  Every Morph can already 
have one of those.

We might extend or revise EventHandler to maintain a Dictionary with 
arbitrary event names (Symbols) as keys, and OrderedCollections of <Object, 
Message> pairs as values, or somesuch.   So we could then define new events 
on the fly.  For Messages that need a dynamic value filled in, I have used 
a BlankMessage subclass (that implements #sentTo:with: and punches the 
value into a copy of itself before sending).

(Overuse of Messages?  I dunno, the class may actually be *under*used.  I 
made AspectModels from Messages/BlankMessages, and it feels a tad more 
encapsulated than distributing setSelector/getSelector/target/argument 
ivars, setters and getters to pluggable widgets.  I'll hopefully be able to 
post an example in a couple of days.)

Just my 2c,
Helge





More information about the Squeak-dev mailing list