Set icon of button to a graphic
chipp at chipp.com
Sun Jan 9 22:07:51 EST 2005
You can try this. Creat a button and put this in the script:
put the windowId of this stack into tWinID
put the rect of grc "redCircle" into tRect
import snapshot from rectangle tRect of window tWinID
set the name of last img to "redCircle"
This will create an image from the graphic "redCircle" which you can now
use to create your buttons.
Bill Vlahos wrote:
> I want to show if an object is either too hot, too cold, or within
> normal temperature range? I was thinking that a simple circle filled
> with green, blue, or red with the temperature next or under it would be
> an easy way to tell at a glance if things are normal. I was thinking
> that if I create a button with the icon set to one of the 3 images and
> setting the label of the button to the temperature would do the trick. I
> would simply set the icon of the button to one of the three "colors".
> I created a 3 small circle graphics (one with each color) but I can't
> seem to select those for the button icon as they are a "graphic" not an
> How can I convert a graphic to an image?
More information about the Use-livecode