Skip to main content

Label

Label only containing text for the user to view.


Config is a struct of the following type:

struct {
const TextAlignment = enum { Left, Center, Right };
/// The text the label will take. For example, if this is 'Example',
/// the user will see the text 'Example'.
text: [:0]const u8 = "",
/// Defines how will the text take up the available space horizontally
alignment: TextAlignment = .Center
};

Functions

NameDescription
fn getText() [:0]const u8Gets the text
fn setText(label: [:0]const u8) voidSets the text

Properties

NameTypeDescription
text[]const u8The text this Label contains
alignmentTextAlignmentHow will the text occupy the available horizontal space

Examples

Label(.{ .text = "Test Label" })