logo       

Re: usage of PluggableListMorph: msg#00041

lang.smalltalk.squeak.beginners

Subject: Re: usage of PluggableListMorph

Hello Konrad,


KK> I?ve got troubles using PluggableListMorph. Ijust need a
KK> ListBox to put some strings into it.

id you google for PluggableMorphsDemo.pr you'll have a demo project
which I tried with 3.6 to 3.8.

I can mail it to you on request.

Here some code I'm currently working on (open with a FileList):
...buildList.st builds the list.

on: sets the target which is the model and has to implement the other
methods listed here. (i usually do it in protocol plugging)

list: just gets a collection whose element populate the list. These
need not be strings.

selected: is a method which returns the current index on the list.
It's an accessor on an Integer, 0 means no selection.

changeSelected: is the method which at least sets the new index but I
also implement the behaviour which the list shows when I click on an
element. This is in ...workUnitSelection.st. The changed at the end
is crucial to tell the PluggableListMorph via the dependency mechanism
to highlight the newly selected item.

beware, listFont is a method of mine which returns a font.

..insertNew.st shows how i add a new element to the list.
daysWork is the model, add: adds the newly created workunit.
the important things are the two changed: notifications.

The first tells the PluggableListMorph that the list has changed
(grown) the second that i fiddled with the index of the list.

KK> irst problem happens when I open a PListMorph inworld - can?t drag it.

use the halo (red), maybe resist being picked up is active.

Or maybe you can't drag it inside the list, this is natural behaviour
of the list.

KK> Secondly I have no idea how to put my choice items intothe
KK> PListMorph. I tried list: but it doesn?t work.

see above, maybe you have to read up on the dependency mechanism.

KK> It would also be very interesting to me if someone knewa
KK> method, which returns a collection of all subclass instances of a
KK> certainclass.

allSubInstances :-)) really.

Cheers,

Herbert mailto:herbertkoenig@xxxxxxx

Attachment: DayfileUI-buildList.st
Description: Binary data

Attachment: DayfileUI-workUnitSelection.st
Description: Binary data

Attachment: DayfileUI-insertNew.st
Description: Binary data

_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise