IMAGE_ACTION_BUTTON
Active element that lets the user launch an action when clicking on the widget.
Attributes brief detailed show all inherited
Examples
- <!-- action button to open menu -->
- <IMAGE_ACTION_BUTTON image="$SCRIPT_DATA_PATH$/menu.png" opaque_mouse_mask="true" cursor="system::hand" action_id="OpenMenu" />

File names
Note that we have three images for the button above:
menu.png
, menu_hover.png
and menu_pushed.png 
We mentioned only "menu.png" in the code, the other files are found automatically due to image file naming conventions.
Using with DEFINE
In practical coding scenarios, IMAGE_ACTION_BUTTON is typically used as a base_type within a DEFINE element to create a reusable custom button. This button can then be easily used multiple times with different actions.
- <!-- define a reusable action button -->
- <DEFINE>
- <MY_BUTTON base_type="IMAGE_ACTION_BUTTON" image="$SCRIPT_DATA_PATH$/menu.png" opaque_mouse_mask="true" cursor="system::hand" />
- </DEFINE>
- <!-- reuse it with different actions -->
- <ROW>
- <MY_BUTTON action_id="OpenMenu" />
- <MY_BUTTON action_id="OpenMenuLM" />
- </ROW>
After editing an image you have to reload the whole skin (not just .kuiml). For images location you can use one of predefined variables like $SCRIPT_DATA_PATH$ or $KUIML_DIR$. Read more info images here.
If you need an element with the same behaviour but without an image, try INVISIBLE_ACTION_BUTTON.
Comments
Please, authorize to view and post comments.