Creating a Toolbar Button

Learn how to create a toolbar button that has an icon with text appearing below it.

2 Comments

Bruce

so does this mean that the image that's been imported must remain on the stack even though its invisible to use this technique?

Trevor DeVore

You don't have to leave the image on the stack but if you decide to move the image to another stack you need to understand how Revolution finds an image based on id.

From the "icon" entry in the docs:
"Revolution looks for the specified image first in the current stack, then in other open stacks."

Let's look at the example from this lesson. When drawing the button icon Revolution is going to search for an image with an id of 1003. If the stack that the button is in does not have an image with an id of 1003 then Revolution begins looking in other stacks. The first image with a matching id that Revolution finds will be displayed.

Now 1003 is a pretty common id in a stack so it is very possible that an image other than the one you were expecting could be displayed. In order to ensure that the right image is displayed you will want to assign an id to the image that will be unique among all open stacks. When placing images in a stack other than the one the button is on I usually start with an id of 50000 and work up from there.

Add your comment

E-Mail me when someone replies to this comment