Checkbox:hide() method
Hide and deactivate the Checkbox (events can no longer be fired).
Return value
This function returns no value.Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Checkbox:hide() 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 buttons)
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
ui.run(win):wait()