Selecting one Checkbox will not affect any other, as Checkboxes are non-exclusive
Checkbox.constructor(parent, caption, [ x ], [ y ], [ width ], [ height ]) constructor
The Checkbox constructor returns a Checkbox value representing a push checkbox on the parent object.
Parameters
parent
An object that will own the Checkbox. Parent objects can be any of Window, Groupbox, TabItem and Panel
caption
A string representing the Checkbox's text.
[x]
An optional number that indicates the Checkbox horizontal position, in pixels. Zero means the left border of the parent.
[y]
An optional number that indicates the Checkbox vertical position, in pixels. Zero means the top border of the parent.
[width]
An optional number that indicates the Checkbox width in pixels, autosized to fit text content if omitted.
[height]
An optional number that indicates the Checkbox height in pixels, autosized to fit text content if omitted.
Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Checkbox.constructor() sample", 320, 200)
-- create a Checkbox on this window, with "LuaRT" as text, at the x position 100, and y position 80
local checkbox = ui.Checkbox(win, "Check if LuaRT is fun", 100, 80)
function checkbox:onClick()
if self.checked then
ui.info("Thank you !")
end
end
win:show()
-- update the user interface until the user closes the Window
repeat
ui.update()
until not win.visible