Checkbox.width read/write property
Get or set the Checkbox area width. The width starts from 0 (left side of the Checkbox) and increases to the right direction.
Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Label.width sample", 320, 140)
local checkbox = ui.Checkbox(win, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", 50)
local inc_btn = ui.Button(win, "Increase width", 15, 50)
local dec_btn = ui.Button(win, "Decrease width", inc_btn.x+150, inc_btn.y)
local function onClick(self)
checkbox.width = checkbox.width + ((self == inc_btn) and 10 or -10)
end
inc_btn.onClick = onClick
dec_btn.onClick = onClick
-- shows the Window
win:show()
-- update user interface
repeat
ui.update()
until not win.visible