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) Canvas.fontsize = 30 function Canvas:onPaint() self:begin() self:clear() self:print("Hello", math.random(0,630), math.random(0, 390), math.random(0xFFFFFFFF)) self:flip() end local button = ui.Button(win, "Hide the Canvas widget") button:center() button.y = 10 function button:onClick() Canvas.visible = not Canvas.visible button.text = (Canvas.visible and "Hide" or "Show").. " the Canvas widget" end ui.run(win):wait()