[][src]Macro uniui_widget_label::u_label

macro_rules! u_label {
    (text: $w:expr, $($param_name:ident: $val:expr),*$(,)*) => { ... };
}

Simplifies Label creation

Parameters:

  • text (required): String,
  • slot_set_text (optional): provided Signal<String> will be connected to [Label::slot_set_text],
  • slot_set_text_proxy (optional): [Label::slot_set_text]'s proxy will be assigned to provided identifier,
  • text_alignment (optional): TextAlignment,
  • slot_set_text_alignment (optional): provided Signal<TextAlignment> will be connected to [Label::slot_set_text_alignment].

Example:

let proxyslot_set_text;

let label = u_label! {
    text: "Hello world!".to_owned(),
    text_alignment: TextAlignment::Center,
    slot_set_text_proxy: proxyslot_set_text,
};

// ...

// Changes label's text to "Goodbye"
proxyslot_set_text.exec_for("Goodbye".to_owned())