Constructs a toolbar group gui object. Group after being constructed needs to be added to a tab for it to be visible in the application. Width is optional, by default width is 3.
local group1 = gui.ToolbarGroup("Group1")
local group1 = gui.ToolbarGroup("Group1", 4)
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.
local button1 = group1:addButton("Button1", "path_to_icon")
local button1 = group1:addButton("Button1", "path_to_icon", function() message("Button clicked") end)
local button1 = gui.ToolbarButton("Button1", "path_to_icon") group1:addButton(button1)
Find toolbar button in group by button label.
local button1 = group1:buttonByName("Button1")
Get and set label for the toolbar group.
message(group1:label())
group1:setLabel("New Group")
Enable or disable the toolbar group.
group1:enable()
group1:disable()
Hide or show the toolbar group.
group1:hide()
group1:show()
Remove the current toolbar group from the tab.
group1:remove()
Return list containing all buttons in the group.
local buttonList = group1:buttons()
Remove button of the given name or by passing in a toolbar button object.
group1:removeButton("Button1")
group1:removeButton(button1)
Get and set width of the toolbar group. Buttons are rearranged when width is changed.
local w = group1:width()
group1:setWidth(2)