This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dev:v3:gui_api:toolbar:toolbarbutton [2020/07/07 09:01] – created jedi18 | dev:v3:gui_api:toolbar:toolbarbutton [2020/07/07 09:06] (current) – jedi18 | ||
---|---|---|---|
Line 22: | Line 22: | ||
---- | ---- | ||
- | ===== Add Button | + | |
+ | ===== Add Callback ===== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | Add lua function callback to be called when the toolbar button is clicked. Multiple callbacks can be added. Callbacks can also be named callbacks i.e. associated with a name so that it can be later removed by use of the name. | ||
+ | |||
+ | * Lua Callback - // | ||
+ | * Callback name - //string// , Lua Callback - // | ||
+ | |||
+ | ==== Examples ==== | ||
+ | |||
+ | * <code lua> button1: | ||
+ | * <code lua> button1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Remove Callback ===== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | Remove lua function called associated with the given name. Only named callbacks can be removed. | ||
+ | |||
+ | * Callback name - // | ||
+ | |||
+ | ==== Examples ==== | ||
+ | |||
+ | * <code lua> button1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Set tooltip | ||
---- | ---- | ||
Line 28: | Line 63: | ||
==== Description ==== | ==== Description ==== | ||
- | Add Toolbar Button to the group of the given **name** and **icon** or by pointer to existing toolbar group. Toolbar | + | Set the tooltip for the button. |
- | * Toolbar Button Label - //string// , Icon path - // | + | * |
- | * returns // | + | |
- | * Toolbar Button Label - //string// , Icon path - //string// , Lua Callback - // | + | |
- | * returns // | + | |
- | * Pointer to Toolbar Button - // | + | |
==== Examples ==== | ==== Examples ==== | ||
- | * <code lua> | + | * <code lua> button1:setTooltip("New Tooltip") </ |
- | * <code lua> local button1 = group1: | + | |
- | * <code lua> local button1 = gui.ToolbarButton(" | + | |
- | | + | |
---- | ---- | ||
Line 81: | Line 109: | ||
==== Description ==== | ==== Description ==== | ||
- | Hide or show the toolbar | + | Hide or show the toolbar |
==== Examples ==== | ==== Examples ==== |