Skip to main content

Module label

Module label 

Source
Expand description

Label widget and properties.

The Label! widget is a text presenter that represents a label.

An optional target widget can be set, the target is focused when the label is clocked.

Labels also integrate with the mnemonic shortcuts and will automatically hide mnemonic markers from text if a parent widget is mnemonic. Labels can also underline the mnemonic character when active if mnemonic_underline is set on the widget or context.

use zng::prelude::*;

Container! {
    child_start = zng::label::Label!("Name", "name-field");
    child_spacing = 5;
    child = TextInput! {
        id = "name-field";
        txt = var_from("");
    };
}

§Full API

See zng_wgt_text_input::label for the full widget API.

Structs§

DefaultStyle
W Default label style.
Label
W Styleable and focusable read-only text widget.

Functions§

mnemonic_underline
P Only draw underline under active mnemonic char in labels.
style_fn
P Extends or replaces the widget style.