[Q]: Update: mechanism

Thierry Reignier thierry_reignier at hotmail.com
Wed Dec 11 10:11:02 UTC 2002


Hi

>I looked at your code - nicely done, btw -
80% is plagiat alias copy/paste from PluggableListMorph
with a personal touch. So maybe that all list morphs should
have a common superclass implementing common behavior!?

>I saw in
>#expandOrCollapse: where the HierarchicalList is triggering the event.
>Which objects are interested in subscribing to this event?
Ideally subclasses of AbstractHierarchicalList, which most of us
use but not for example CategoricalSMLoader (being a subclass
of Morph)... giving me this triggerEvent headache.

and I have actually found that
CategoricalSMLoader >>buildMorphicCategoriesList
	|list |
	list _ SimpleHierarchicalListMorph
		on: ***self***
		list: #getList
		selected: #getCurrentSelection
		changeSelected: #noteNewSelection:
		menu: #genericMenu:
		keystroke: nil.
	self categoryExplorer addDependent: list.
	^list
where ***self*** should maybe be "self categoryExplorer". I will
test it and talk to the owner.

>Could it be the container that has embedded the
>hierarchy list morph [needs to be notify]?
Well not the parent morph but the model associated with the
list morph (a subclass of AbstractHierarchicalList).
In my case my model’s list can vary, items can be removed,
restored, filtered. I need to keep a list synchronized with the
list of itemMorphs.

>Here's my philosophy regarding events in the UI. parent -> child 
>relationship  (morph -> model, or container morph ->
>contained morph), the child should trigger events However, when the parent 
>changes, the parent
>should direct the child with message sends,
I take a note. Then in my case it must be direct messages to my model.
My original idea with update: was to introduce new code without breaking
someone else existing code.

>So perhaps it should be the itemMorph that triggers the event and the 
>parent
>that has registered an action for this event.  The parent may then 
>retrigger
>an event for its parents.
Interesting. I will look at it for a later version of my code.

Summary: I will implement direct messages and I need to look at
Categorical SM Laoder and ask for correction / additions.

cheers


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail




More information about the Squeak-dev mailing list