Button:show() method
Show and activate the Button (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("Button:show() sample", 320, 200)
local button = ui.Button(win, "Click Me (if you can !)", 100, 80)
-- Hides the button when hovering it
function button:onHover()
self:hide()
end
-- Shows the button when hovering the button area
function win:onHover(x,y buttons)
if (x > button.x and x < button.x + button.width) or (y > button.y and y < button.y + button.height) then
button:show()
end
end
ui.run(win):wait()