ui.remove(widget)

Removes a widget from its parent.

Once a widget is removed, it should not be accessed anymore and will be garbagecollected at the next garbage collection step.

Parameters

widget

The widget to be removed.

Return value

This function returns no value.

Example

local ui = require "ui" -- create a simple Window local win = ui.Window("ui.remove() sample", 320, 230) -- create a Button on this window local button = ui.Button(win, "Self-destruction !", 100, 90) -- Button onClick event : remove the window function button:onClick() ui.remove(win) end win:show() -- update the user interface until the user closes the Window repeat ui.update() until not win.visible