[Q] PluggableListMorph list question
Lic. Edgar J. De Cleene
edgardec2001 at yahoo.com.ar
Fri Aug 22 11:02:27 UTC 2003
On 21/08/03 19:02, "Ned Konz" <ned at bike-nomad.com> wrote:
> 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
>
Ned:
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.
Cheers.
Edgar
More information about the Squeak-dev
mailing list
|