Button.parent readonly property


Get the parent widget that owns the Button.

Example

local ui = require "ui" -- create a simple window local win = ui.Window("Button.parent sample", 320, 200) -- create a Tab with one page local tab = ui.Tab(win, {"Page 1"}) -- create a button on the first page local button = ui.Button(tab.items[1], "Show Button parent", 100, 70) function button:onClick() ui.info("Button's parent is a "..type(button.parent)) end tab.align = "all" win:show() -- update the user interface until the user closes the Window repeat ui.update() until not win.visible