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
Hello Konrad,
KK> Ive 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 - cant 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 doesnt 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@gmx.net
beginners@lists.squeakfoundation.org