上QQ阅读APP看书,第一时间看更新
Including state graphics on buttons
Buttons have six states in LiveCode: enabled, highlighted, disabled, visited, armed, and hover. Each of these states can have an associated icon to help us communicate with our users. In this recipe, you will learn how to include state graphics on your buttons.
How to do it...
To include graphics on buttons, perform these steps:
- Create a new main stack.
- Drag a button to the stack's card.
- Select, with a single click, the button you want to modify.
- Right-click on the button and select Property Inspector.
- Using the property inspector, select, Icons & Border. This will bring up the interface shown in the following screenshot:
- Select the button state you want to modify. An explanation of each state is in the following table:
- If you know the object ID number of the graphic you want to use, enter it directly. Otherwise, you can use the browse tool to the right of the text entry field.
How it works...
We can tell LiveCode which images are to be used for each button state by referring to the graphic's object ID. As the button's state changes, so will its graphic (icon).