[Q] PluggableListMorph list question

Bob Arning arning at charm.net
Fri Aug 22 12:12:20 UTC 2003


On Fri, 22 Aug 2003 08:02:27 -0300 "Lic. Edgar J. De Cleene" <edgardec2001 at yahoo.com.ar> wrote:
>As usual I learn a lot from you.
>But my answer remains still.
>This time I know what you are saying, but, what if you have a
>PluggableListMorph  embebed in other Morph and wish add a new member to your
>previous ?
>
>How you get list if you don't have
>List
>^list 
>
>Thot is what I'm asking.

Edgar,

The short answer:

You are not expected to get the list from the PLM. The expectation is that you will already have the list since you created it in the first place. 

A slightly longer answer:

The way PluggableListMorph is normally used, the PLM handles the View responsibilities and some other object (let's call it Edgar's Model or EM for short) will handle the Model responsibilities. EM have a history that looks somthing like this...

- EM has a list of objects to display stored in an instance variable, myList, for example
- EM implements a method #myList which answers the current contents of that list
- EM creates a PluggableListMorph to display those objects. One part of that creation is to tell the PLM the name associated with the list. EM tells the PLM that #myList is that name.
- as a part of the PLM initialization, PLM will send #myList to EM to get the current contents and will display those contents.
- time passes......
- EM decides to add some items to the list.
- EM adds those items to the list in the variable myList
- EM then says 
	self changed: #myList
- the PLM receives a messages as a result of this and sends #myList to EM
- the PLM updates its display to reflect the contents just received.

Hope this helps.

Cheers,
Bob



More information about the Squeak-dev mailing list