pub struct Label { /* private fields */ }Expand description
Shows text on the screen.
let label = Label::new("Hello world".to_owned());
lable.slot_set_text_alignment().exec_for(TextAlignment::Center);§Macros
You can use [u_label!] to simplify Label creation/setup:
let label = u_label! {
text: "Hello world!".to_owned(),
text_alignment: TextAlignment::Center,
};Implementations§
Source§impl Label
impl Label
Sourcepub fn new(text: String) -> Label
pub fn new(text: String) -> Label
Creates new Label with provided text. You may be interested in [u_label!] to simplify Label creation/setup.
let label = Label::new("Hello".to_owned());Sourcepub fn slot_set_text(&self) -> &dyn Slot<String>
pub fn slot_set_text(&self) -> &dyn Slot<String>
Label’s text can be changed via provided slot
let label = u_label!{
text: "Hello".to_owned(),
};
let mut signal = Signal::new();
signal.connect_slot(label.slot_set_text);
// <...>
// Changes label's text to "Goodbye"
signal.emit("Goodbye".to_owned());Sourcepub fn slot_set_text_alignment(&self) -> &dyn Slot<TextAlignment>
pub fn slot_set_text_alignment(&self) -> &dyn Slot<TextAlignment>
Label’s text alignment can be changed via provided slot
let label = u_lable!{
text: "Hello".to_owned(),
};
let mut signal = Signal::new();
signal.connect_slot(label.slot_set_text_alignment());
// <...>
// Changes text alignemnt
signal.emit(TextAligment::Center);Trait Implementations§
Source§impl DataProcessor for Label
impl DataProcessor for Label
Source§fn process_data(&mut self, _: i64, _: &mut dyn UiPageContext)
fn process_data(&mut self, _: i64, _: &mut dyn UiPageContext)
Will be called by crate::Application time to time Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Label
impl !Send for Label
impl !Sync for Label
impl !UnwindSafe for Label
impl Freeze for Label
impl Unpin for Label
impl UnsafeUnpin 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