pub struct Label(/* private fields */);
Available on crate feature
gui
only.Expand description
Native label control.
Implementations§
source§impl Label
impl Label
sourcepub fn new(parent: &impl GuiParent, opts: LabelOpts) -> Self
pub fn new(parent: &impl GuiParent, opts: LabelOpts) -> Self
Instantiates a new Label
object, to be created on the parent window
with
HWND::CreateWindowEx
.
§Panics
Panics if the parent window was already created – that is, you cannot
dynamically create a Label
in an event closure.
sourcepub fn new_dlg(
parent: &impl GuiParent,
ctrl_id: u16,
resize_behavior: (Horz, Vert)
) -> Self
pub fn new_dlg( parent: &impl GuiParent, ctrl_id: u16, resize_behavior: (Horz, Vert) ) -> Self
Instantiates a new CheckBox
object, to be loaded from a dialog
resource with
HWND::GetDlgItem
.
§Panics
Panics if the parent dialog was already created – that is, you cannot
dynamically create a Label
in an event closure.
sourcepub fn set_text_and_resize(&self, text: &str)
pub fn set_text_and_resize(&self, text: &str)
Trait Implementations§
source§impl GuiNativeControl for Label
impl GuiNativeControl for Label
source§fn on_subclass(&self) -> &WindowEvents
fn on_subclass(&self) -> &WindowEvents
Exposes the subclass events. If at least one event exists, the control
will be
subclassed. Read more
source§impl GuiNativeControlEvents<LabelEvents> for Label
impl GuiNativeControlEvents<LabelEvents> for Label
source§fn on(&self) -> &LabelEvents
fn on(&self) -> &LabelEvents
Exposes the specific control events. Read more
source§impl GuiWindowText for Label
impl GuiWindowText for Label
source§fn set_text(&self, text: &str)
fn set_text(&self, text: &str)
Sets the text by calling
HWND::SetWindowText
.source§fn text(&self) -> String
fn text(&self) -> String
Retrieves the text by calling
HWND::GetWindowText
.impl Send for Label
Auto Trait Implementations§
impl Freeze for Label
impl !RefUnwindSafe for Label
impl !Sync for Label
impl Unpin for Label
impl !UnwindSafe for Label
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more