[Q] PluggableListMorph list question

Ned Konz ned at bike-nomad.com
Thu Aug 21 22:02:04 UTC 2003


On Thursday 21 August 2003 07:19 am, Lic. Edgar J. De Cleene wrote:
> If I get one instance or PluggableListMorph by doing:
>
> l _ PluggableListMorph new openInWorld.
> l list: #('uno' 'dos' 'tres') in a Workspace.
>
> What is a correct form for add a new item ?
>
> If I have ;
>
> List
> ^ list
>
> I could do then:
>
> newList _ l list asOrderedCollection.
> newList add: 'cuatro'.
>
> l list: newList.
>
> But I don't have list implemented in PluggableListMorph .( Why not
> ? )

Because it's Pluggable.

You don't make them using 'new', generally; you use one of the 
class-side constructors.

And you can specify what the get-list, get-selection, and 
set-selection selectors are (as well as some others).

So here, the get-list selector is #yourself, and the get-selected 
selector is #size. And when I change the list, I have to send a 
#changed method whose aspect is the same as the selector:

l _ OrderedCollection withAll: #(uno dos tres).
plm _ PluggableListMorph on: l list: #yourself selected: #size 
changeSelected: nil.
plm openInWorld.
l addLast: #cuatro; changed: #yourself.


-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list