• 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

Both sides previous revisionPrevious revision
dev:v3:gui_api:toolbar:toolbarbutton [2020/07/07 09:05] – jedi18dev:v3:gui_api:toolbar:toolbarbutton [2020/07/07 09:06] (current) – jedi18
Line 22: Line 22:
  
 ---- ----
 +
 +===== 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 ===== ===== Set tooltip =====
  
dev/v3/gui_api/toolbar/toolbarbutton.1594112731.txt.gz · Last modified: 2020/07/07 09:05 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