Label

A widget primarily used for showing text in a user interface. These widgets are often used to provide descriptions, titles, or informative messages within an application. They help in presenting static content that users can read or refer to as part of the interface design.

local label = Label(text)

Properties

setOnClick(callback)

Executed when the widget is clicked.

setText(text)

Sets text on the label

getText()

Returns the text displayed on the widget

setTextAlign(align)

Set how the text is aligned. Available options include left, right, bottom, top, center, hcenter and vcenter

setWordWrap(enable: bool)

Enable or disable word wrap

setBold(enable: bool)

Enable or disable bold text

setTextSize(size)

Sets text size

setCompanion(widget)

When the user hits the specific shortcut key shown on the label, the keyboard focus moves to the widget linked with that label.

The companion system works exclusively for Labels that have text where a single character has an '&' symbol before it. This ‘&’ character is assigned as the shortcut key.