usage of PluggableListMorph

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

usage of PluggableListMorph

Konrad.Krentz

Hi all,

 

I’ve got troubles using PluggableListMorph. I just need a ListBox to put some strings into it.

The first problem happens when I open a PListMorph in world - can’t drag it.

Secondly I have no idea how to put my choice items into the PListMorph. I tried list: but it doesn’t work.

It would also be very interesting to me if someone knew a method, which returns a collection of all subclass instances of a certain class.

 

Thanks for your answers

 

Konrad


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: usage of PluggableListMorph

Herbert König
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:[hidden email]
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

DayfileUI-buildList.st (650 bytes) Download Attachment
DayfileUI-workUnitSelection.st (440 bytes) Download Attachment
DayfileUI-insertNew.st (814 bytes) Download Attachment