Canvas:hide() method


Hide the Canvas widget.

Return value

This function returns no value.

Example

local ui = require "ui" require "canvas" -- create a simple Canvas local win = ui.Window("Canvas.visible sample", "fixed", 640, 480) local Canvas = ui.Canvas(win, 0, 50, 640, 430) function Canvas:onPaint() canvas:clear() self:print("Hello", math.random(0,630), math.random(0, 390)) end local button = ui.Button(win, "Hide the Canvas widget") button:center() button.y = 10 win:show() function button:onClick() Canvas:hide() end while win.visible do ui.update() end