[Pharo-project] icons in pluggablelistmorph
Hi, I would like to specify an icon in a PluggableListMorph, but I cannot find my way :). Can anyone tell me how to do it? Cheers, Doru -- www.tudorgirba.com "Problem solving efficiency grows with the abstractness level of problem understanding."
Maybe you can have a look at how OB does. By overriding the OBNode>>icon, an icon appears on left to the item name. Cheers, Alexandre On 11 Sep 2009, at 14:13, Tudor Girba wrote:
Hi,
I would like to specify an icon in a PluggableListMorph, but I cannot find my way :). Can anyone tell me how to do it?
Cheers, Doru
-- www.tudorgirba.com
"Problem solving efficiency grows with the abstractness level of problem understanding."
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
I would like to specify an icon in a PluggableListMorph, but I cannot find my way :). Can anyone tell me how to do it?
You need to create a subclass of PluggableListMorph and LazyListMorph, override #listMorphClass in the PluggableListMorph to return the lazy morph class, and override the method #display:atRow:on: in the LazyListMorph subclass to customize the low-level drawing of the list item. As you imagined all pretty simple and strait-forward, have a look at the OB-Morphic for an example :-) Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch
Thanks Lukas. Indeed, it is straightforward :). I will give it a try. Cheers, Doru On 11 Sep 2009, at 20:28, Lukas Renggli wrote:
I would like to specify an icon in a PluggableListMorph, but I cannot find my way :). Can anyone tell me how to do it?
You need to create a subclass of PluggableListMorph and LazyListMorph, override #listMorphClass in the PluggableListMorph to return the lazy morph class, and override the method #display:atRow:on: in the LazyListMorph subclass to customize the low-level drawing of the list item.
As you imagined all pretty simple and strait-forward, have a look at the OB-Morphic for an example :-)
Cheers, Lukas
-- Lukas Renggli http://www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com "If you interrupt the barber while he is cutting your hair, you will end up with a messy haircut."
There's always Polymorph's PluggableIconListMorph... Should do what you need. Regards, Gary ----- Original Message ----- From: "Tudor Girba" <girba@iam.unibe.ch> To: <Pharo-project@lists.gforge.inria.fr> Sent: Friday, September 11, 2009 9:12 PM Subject: Re: [Pharo-project] icons in pluggablelistmorph
Thanks Lukas. Indeed, it is straightforward :).
I will give it a try.
Cheers, Doru
On 11 Sep 2009, at 20:28, Lukas Renggli wrote:
I would like to specify an icon in a PluggableListMorph, but I cannot find my way :). Can anyone tell me how to do it?
You need to create a subclass of PluggableListMorph and LazyListMorph, override #listMorphClass in the PluggableListMorph to return the lazy morph class, and override the method #display:atRow:on: in the LazyListMorph subclass to customize the low-level drawing of the list item.
As you imagined all pretty simple and strait-forward, have a look at the OB-Morphic for an example :-)
Cheers, Lukas
-- Lukas Renggli http://www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com
"If you interrupt the barber while he is cutting your hair, you will end up with a messy haircut."
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
doru do you also need to do what lukas suggested with the tree of alain? Is there a reason not to use it? Stef On Sep 11, 2009, at 8:13 PM, Tudor Girba wrote:
Hi,
I would like to specify an icon in a PluggableListMorph, but I cannot find my way :). Can anyone tell me how to do it?
Cheers, Doru
-- www.tudorgirba.com
"Problem solving efficiency grows with the abstractness level of problem understanding."
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Hi Stef, The MorphTreeMorph widget of Alain follows a different design and already provides a straightforward way to deal with icons. I already use it for displaying trees in Glamour. But, that tree widget appears to be significantly slower for displaying simple lists. That is why I want to try with PluggableListMorph to see what can be done and with what performance. Cheers, Doru On 11 Sep 2009, at 20:40, Stéphane Ducasse wrote:
doru
do you also need to do what lukas suggested with the tree of alain? Is there a reason not to use it?
Stef On Sep 11, 2009, at 8:13 PM, Tudor Girba wrote:
Hi,
I would like to specify an icon in a PluggableListMorph, but I cannot find my way :). Can anyone tell me how to do it?
Cheers, Doru
-- www.tudorgirba.com
"Problem solving efficiency grows with the abstractness level of problem understanding."
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com "Being happy is a matter of choice."
participants (5)
-
Alexandre Bergel -
Gary Chambers -
Lukas Renggli -
Stéphane Ducasse -
Tudor Girba