Canvas.parent readonly property


Get the parent object that owns the Canvas.

Example

local ui = require "ui" require "canvas" -- create a simple Canvas local win = ui.Window("Canvas.parent sample", 640, 480) local Canvas = ui.Canvas(win, 0, 50, 640, 500) Canvas:clear(0xd5a0f8) Canvas:flip() local button = ui.Button(win, "Click to show Canvas.parent") button:center() button.y = 10 function button:onClick() ui.info("Canvas parent is "..tostring(Canvas.parent)) end win:show() -- update the user interface until the user closes the Window repeat ui.update() until not win.visible