TreeView icon question

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

TreeView icon question

Bruno Brasesco
Dear all,

Is there any way to change dynamically the icons in a TreeView (we do not
want to use the class icons neither to change it) ?

Best Regards
Bruno Brasesco


Reply | Threaded
Open this post in threaded view
|

RE: TreeView icon question

Smalltalkiano
Bruno,

    try answering YourObject>>icon the icon you want (change it dynamically)

in YourObject:

    initialize
        icon := Icon fromFile: 'c:\path\yourIcon.ico'

    setUglyIcon
        self icon: self uglyIcon

    setBeautyIcon
        self icon: self beautyIcon

regards

Seb


Bruno Brasesco <[hidden email]> escribió en el mensaje de noticias
9haqnu$d84k8$[hidden email]...

> Dear all,
>
> Is there any way to change dynamically the icons in a TreeView (we do not
> want to use the class icons neither to change it) ?
>
> Best Regards
> Bruno Brasesco
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: TreeView icon question

Blair McGlashan
In reply to this post by Bruno Brasesco
Bruno

You wrote in message news:9haqnu$d84k8$[hidden email]...
>
> Is there any way to change dynamically the icons in a TreeView (we do not
> want to use the class icons neither to change it) ?

This is the purpose of the #getImageBlock: aspect of the TreeView. The
argument to the block is the object being drawn. The block should evaluate
to the integer representing the image to be used, where that integer is the
index of the icon in the TreeView's image list. This index is easily
acquired by sending any Icon the #imageIndex messsage. Return 0 if you don't
want to display an image against a particular item.

Regards

Blair