This commit is contained in:
Robert Jelic
2022-07-17 23:17:28 +02:00
parent dfc53658f1
commit af34fa1a18
14 changed files with 67 additions and 134 deletions

View File

@@ -5,7 +5,7 @@ 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.
This is how you would create a event which gets fired as soon as the value gets changed:
```lua
local mainFrame = basalt.createFrame()
local aCheckbox = mainFrame:addCheckbox()
@@ -17,7 +17,7 @@ end
aCheckbox:onChange(checkboxChange)
```
## Lua and XML:
also possible via xml:
```lua
local mainFrame = basalt.createFrame():addLayout("example.xml")
@@ -28,6 +28,6 @@ end)
```
```xml
<button onChange="checkboxChange" />
<checkbox onChange="checkboxChange" />
```