Class widget:label
Label widget
This module is only available from the UI process Lua state.
The label widget shows a single line of formatted text. It is not editable by the user.
Properties
label.padding
Type: table
Read-write
The widget padding. Table has two fields,
x
and y
, representing the
vertical and horizontal padding respectively, in pixels.
Available only for older versions of GTK (< 2.14).
label.align
Type: table
Read-write
The text alignment. Table has two fields,
x
and y
, representing the
vertical and horizontal alignment respectively. Values should be between
0--1, where 0 means aligned to the left/top, and 1 means aligned to the
right/bottom.
label.text
Type: string
Read-write
Text to display in the widget. This property uses Pango markup.
label.fg
Type: string
Read-write
The color of the text displayed by the widget. This can be changed with
markup set by the
text
property.
label.bg
Type: string
Read-write
The background color of the label widget.
label.font
Type: string
Read-write
The font to use to display the label text.
label.selectable
Type: boolean
Default:
false
Read-write
Whether the text can be selected by dragging with the mouse cursor.
label.textwidth
Type: integer
Read-write
The desired width of the label, in characters.
Signals
"key-press"
Emitted when a key is pressed while the label widget has the input focus.
Parameters
-
modifiersType: tableAn array of strings, one for each modifier key held.
-
keyType: stringThe key that was pressed, if printable, or a keysym otherwise.
Return Values
-
boolean
true
if the event has been handled and should not be propagated further.
Attribution
Copyright
- 2010 Mason Larobina