• skip to content

Wiki

User Tools

  • Admin
  • Log In

Site Tools

  • Recent Changes
  • Media Manager
  • Sitemap
Trace:

dev:v3:gui_api:toolbar:toolbarbutton

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dev:v3:gui_api:toolbar:toolbarbutton [2020/07/07 09:01] – created jedi18dev: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 - //kaguya::LuaRef// 
 +  * Callback name - //string// , Lua Callback - //kaguya::LuaRef// 
 + 
 +==== Examples ==== 
 + 
 +  * <code lua> button1:addCallback(function() run_command("LINE") end) </code> 
 +  * <code lua> button1:addCallback("message_callback", function() message("Test") end) </code> 
 + 
 +---- 
 + 
 +===== Remove Callback ===== 
 + 
 +---- 
 + 
 +==== Description ==== 
 + 
 +Remove lua function called associated with the given name. Only named callbacks can be removed. 
 + 
 +  * Callback name - //string// 
 + 
 +==== Examples ==== 
 + 
 +  * <code lua> button1:removeCallback("message_callback") </code> 
 + 
 +---- 
 + 
 +===== 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 button callback can also be passed in.+Set the tooltip for the button.
  
-  * Toolbar Button Label - //string// , Icon path - //string// +  *  New tooltip - //string//
-    * returns //ToolbarButton//  +
-  * Toolbar Button Label - //string// , Icon path - //string// , Lua Callback - //kaguya::LuaRef// +
-    * returns //ToolbarButton// +
-  * Pointer to Toolbar Button - //ToolbarButton//+
  
 ==== Examples ==== ==== Examples ====
  
-  * <code lua> local button1 = group1:addButton("Button1", "path_to_icon") </code> +  * <code lua> button1:setTooltip("New Tooltip") </code>
-  * <code lua> local button1 = group1:addButton("Button1", "path_to_icon", function() message("Button clicked") end) </code> +
-  * <code lua> local button1 = gui.ToolbarButton("Button1", "path_to_icon") +
- group1:addButton(button1)</code>+
  
 ---- ----
Line 81: Line 109:
 ==== Description ==== ==== Description ====
  
-Hide or show the toolbar group.+Hide or show the toolbar button.
  
 ==== Examples ==== ==== Examples ====
dev/v3/gui_api/toolbar/toolbarbutton.1594112504.txt.gz · Last modified: 2020/07/07 09:01 by jedi18

Page Tools

  • Show page
  • Old revisions
  • Backlinks
  • Export to PDF
  • Rename Page
  • Back to top
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki