Button
Buttons are used to trigger actions.
Playground
Use the switch to enable the sub button and edit its label.
Usage
You can create a Button by calling the AddButton method on a Groupbox.
Choose between positional arguments for quick calls or a configuration table for more customization.
Positional Arguments
Groupbox:AddButton("This is a button", function()
print("Button clicked!")
end)| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Text of the button | string | nil |
| 2 | Callback function | function | nil |
Configuration Table
Groupbox:AddButton({
Text = "This is a button",
Func = function()
print("Button clicked!")
end
})Prop
Type
Sub Button
You can also add a sub button to a button.
local MainButton = Groupbox:AddButton({
Text = "Button",
Func = function()
print("Button clicked!")
end
})
MainButton:AddButton({
Text = "Sub Button",
Func = function()
print("Sub button clicked!")
end
})