Checkbox:onClick() event


This event is fired when the user has clicked on the Checkbox.

Return value

The event returns no value.

Example

local ui = require "ui" -- create a simple window local win = ui.Window("Checkbox.onClick sample", 200, 100) local checkbox = ui.Checkbox(win, "Check Me !", 66, 30) -- Checkbox onClick event function checkbox:onClick() win:status("Your choice : "..(self.checked and "checked" or "unchecked")) end -- shows the window win:show() -- update status checkbox:onClick() -- update user interface repeat ui.update() until not win.visible