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) 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 -- Impossible ! function button: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