User Tools

Site Tools


Sidebar

Introduction

* Home

Documentation & help

LibreCAD Community

Help on DokuWiki

Temporary shorcuts

dev:v3:gui_api:toolbar:toolbarbutton

This is an old revision of the document!


Toolbar Button GUI Class

Github Link

 namespace lc::ui::api 

Toolbar Button Constructor


Description

Constructs a toolbar button gui object. Button after being constructed needs to be added to a group for it to be visible in the application.

  • Toolbar Button Name - string , Icon Path - string , Lua Callback - kaguya::LuaRef , Tooltip(Default = “”) - string , Checkable(Default = false) - bool
  • Toolbar Button Name - string , Icon Path - string , Tooltip(Default = “”) - string , Checkable(Default = false) - bool

Examples

  •  local button1 = gui.ToolbarButton("Button1", "icon_path", function() message("Test") end) 
  •  local button1 = gui.ToolbarButton("Button1", "icon_path") 
  •  local button1 = gui.ToolbarButton("Button1", "icon_path", function() message("Test") end), "Tooltip", true) 

Set tooltip


Description

Set the tooltip for the button.

  • New tooltip - string

Examples

  •  button1:setTooltip("New Tooltip") 

Label


Description

Get and set label for the toolbar button.

Examples

  •  message(button1:label()) 
  •  button1:setLabel("New Button")

Enable and Disable


Description

Enable or disable the toolbar button.

Examples

  •  button1:enable() 
  •  button1:disable() 

Hide and Show


Description

Hide or show the toolbar button.

Examples

  •  button1:hide() 
  •  button1:show() 

Remove


Description

Remove the current toolbar button from the group.

Examples

  •  button1:remove() 

Checkable


Description

Return if the button is checkable or not.

Examples

  •  local isCheckable = button1:checkable() 

dev/v3/gui_api/toolbar/toolbarbutton.1594112731.txt.gz · Last modified: 2020/07/07 09:05 by jedi18