Canvas.enabled read/write property


Get or set the Canvas ability to respond to mouse, and any other events. When set to false, disable the Canvas (the user will not be able to interact with it), and Canvas's events won't be fired anymore.

Example

local ui = require "ui" require "canvas" -- create a simple Window local win = ui.Window("Canvas.enabled sample", 320, 200) local Canvas = ui.Canvas(win) Canvas.align = "all" -- disable the Canvas Canvas.enabled = false -- onClick event won't be fired as the Canvas is disabled function Canvas:onClick(x, y) ui.info("You have clicked on the Canvas at position "..x..", "..y) end win:show() -- update user interface repeat ui.update() until not win.visible