Files
Basalt/docs/objects/Checkbox.md
2022-06-26 17:52:08 +02:00

21 lines
667 B
Markdown

With checkbox objects the user can set a bool to true or false
Remember checkbox also inherits from [Object](objects/Object.md)
A checkbox does not have any custom methods. All required methods are provided by the base [object](objects/Object.md) class.
# Example
This is how you would create a event which gets fired as soon as the value gets changed.
```lua
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aCheckbox = mainFrame:addCheckbox("myFirstCheckbox"):show()
local function checkboxChange(self)
local checked = self:getValue()
basalt.debug("The value got changed into ", checked) end)
end
aCheckbox:onChange(checkboxChange)
```