Label:constructor(parent, caption, [x], [y], [width], [height])constructor
The Label constructor returns a Label value representing a static text area on the parent object.
Parameters
parent
An object that will own the Label. Parent objects can be any of Window, Groupbox, TabItem and Panel
caption
A string representing the Label's text.
[x]
An optional number that indicates the Label horizontal position, in pixels. Zero means the left border of the parent.
[y]
An optional number that indicates the Label vertical position, in pixels. Zero means the top border of the parent.
[width]
An optional number that indicates the Label width in pixels, autosized to fit text content if omitted.
[height]
An optional number that indicates the Label height in pixels, autosized to fit text content if omitted.
Return value
The constructor returns a new Label instance.Example
--! luart-extensions
import ui
-- create a simple Window
local win = ui.Window("Label.constructor() sample", 320, 200)
-- create a Label on this window, with "LuaRT" as text, at the x position 130, and y position 80
local label = ui.Label(win, "LuaRT", 130, 80)
win:show()
-- update the user interface until the user closes the Window
repeat
ui.update()
until not win.visible