Checkbox.enabled read/write property


Get or set the checkbox ability to respond to mouse, and any other events. When set to false, disable the Checkbox (the user will not be able to interact with it), and checkbox's events won't be fired anymore.

Example

local ui = require "ui" -- create a simple Window local win = ui.Window("Checkbox.enabled sample", 320, 200) local checkbox = ui.Checkbox(win, "I'm disabled :(", 130, 80) -- disable the checkbox checkbox.enabled = false win:show() -- checkbox:onClick() event (won't be fired !) function checkbox:onClick() ui.info("You have clicked on the checkbox !!") end -- update user interface repeat ui.update() until not win.visible