Lost in Squeak world....

Ned Konz ned at bike-nomad.com
Sun Feb 11 21:41:54 UTC 2001


On Sunday 11 February 2001 13:29, Ned Konz wrote:

> I take it that you've figured out how to construct a PluggableListView
> already (using class-side constructors that take a model and selectors).
>
> Now to change the contents, your model just does
>
> 	self changed: #getListSel
>
> and then the view will go back to the model and ask it for the list using
> the selector that you passed to the constructor.
>
> Note that unless you're trying to make a UI for MVC usage, you may want to
> use PluggableListMorph instead of PluggableListView (this will be easier to
> debug, as you can make one by itself and play with it).
>
> Keep browsing! One thing you could do is browse the code of some of the
> browsers that use the PluggableList* classes. Just browse for class
> references to PluggableListView or PluggableListMorph.

I should explain the above a bit, sorry:
The argument to changed: in the example above should be the same selector 
that you gave to the constructor to get the list.

If you're using Morphic, you can try this:

a _ SortedCollection withAll: #(a b c d e f).
plv _ PluggableListMorph on: a
 list: #asSortedCollection
 selected: nil 
changeSelected: nil.
plv openInWorld

Now you'll have a PluggableListMorph up in the upper left hand corner of your 
screen. Then if you want to add an object to your list:

a addLast: #aardvark.

Your model (in this case, the SortedCollection called a) will then notify the 
list morph by sending itself a changed message with the same selector (in 
this case, #asSortedCollection) that you gave the constructor:

a changed: #asSortedCollection

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com





More information about the Squeak-dev mailing list