Checkbox:show() method


Show and activate the Checkbox (events can now be fired).

Return value

This function returns no value.

Example

local ui = require "ui" -- create a simple Window local win = ui.Window("Checkbox:show() sample", 320, 200) local checkbox = ui.Checkbox(win, "Click Me (if you can !)", 100, 80) -- Hides the checkbox when hovering it function checkbox:onHover() self:hide() end -- Shows the checkbox when hovering the checkbox area function win:onHover(x, y) if (x < checkbox.x or x > checkbox.x + checkbox.width) or (y < checkbox.y or y > checkbox.y + checkbox.height) then checkbox:show() end end -- Impossible ! function checkbox:onClick() ui.msg("Great job !!") end win:show() -- update the user interface until the user closes the Window repeat ui.update() until not win.visible