class controls.Label(Widget)

A Label displays a piece of static text in a chosen font and colour.

Constructor

Label(text, width = None)
Initializes the label with the given text and font. If a width is specified, it is used, otherwise the label is initially made just wide enough to contain the text. The text may consist of more than one line, separated by '\n'. The initial height is determined by the number of lines and the font specified at construction time or the default font from the theme.

Theme Properties

font
The font in which to display the text.

fg_color
The colour in which to display the text.

Properties

text
The text to be displayed. This can be changed dynamically, but the label won't automatically resize to accommodate the new text.

align
Specifies the alignment of the text within the widget's rect. One of 'l', 'c' or 'r' for left, centre or right.
---