Canvas:show() method


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

Return value

This function returns no value.

Example

local ui = require "ui" require "canvas" -- create a simple Canvas local win = ui.Window("Canvas.show() sample", 640, 480) local Canvas = ui.Canvas(win, 0, 50, 640, 430) Canvas.fontsize = 28 Canvas:hide() local button = ui.Button(win, "Show the Canvas widget") button:center() button.y = 10 win:show() function Canvas:onPaint() self:clear() self:print("Hello, it's me !", 250, 190, math.random(0, 0xFFFFFFFF)) end function button:onClick() Canvas:show() end while win.visible do ui.update() end