Struct native_windows_gui::Label [−][src]
pub struct Label { pub handle: ControlHandle, // some fields omitted }
Expand description
A label is a single line of static text. Use \r\n
to split the text on multiple lines.
Label is not behind any features.
Builder parameters:
parent
: Required. The label parent container.text
: The label text.size
: The label size.position
: The label position.enabled
: If the label is enabled. A disabled label won’t trigger eventsflags
: A combination of the LabelFlags values.ex_flags
: A combination of win32 window extended flags. Unlikeflags
, ex_flags must be used straight from winapifont
: The font used for the label textbackground_color
: The background color of the labelh_align
: The horizontal aligment of the label
Control events:
OnLabelClick
: When the user click the labelOnLabelDoubleClick
: When the user double click a labelMousePress(_)
: Generic mouse press events on the labelOnMouseMove
: Generic mouse mouse eventOnMouseWheel
: Generic mouse wheel event
** Example **
use native_windows_gui as nwg; fn build_label(label: &mut nwg::Label, window: &nwg::Window, font: &nwg::Font) { nwg::Label::builder() .text("Hello") .font(Some(font)) .parent(window) .build(label); }
Fields
handle: ControlHandle
Implementations
Return true if the control user can interact with the control, return false otherwise
Enable or disable the control
Return true if the control is visible to the user. Will return true even if the control is outside of the parent client view (ex: at the position (10000, 10000))
Show or hide the control to the user
Set the position of the label in the parent window
Winapi class name used during control creation
Winapi flags required by the control
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Label
impl UnwindSafe for Label