pub struct LabelWidget { /* private fields */ }Expand description
§Description
A basic text widget. It can be single lined if your text fits within the width of the widget or it canbe multilined if your text exceeds it and its height is greater than 1
Implementations§
Source§impl LabelWidget
impl LabelWidget
Sourcepub fn new(
x: i32,
y: i32,
max_width: u32,
max_height: u32,
text: &str,
) -> Rc<RefCell<Self>>
pub fn new( x: i32, y: i32, max_width: u32, max_height: u32, text: &str, ) -> Rc<RefCell<Self>>
§Description
Creates a new label
§Arguments
x: i32 - The x position of the labely: i32 - The y position of the labelmax_width: i32 - The maximum width of the labelmax_height: i32 - The maximum height of the labeltext: &str - The text to be shown on the label
§Returns
Rc<RefCell<LabelWidget>> - A newly created label widget
Trait Implementations§
Source§impl Widget for LabelWidget
impl Widget for LabelWidget
Source§fn draw(
&mut self,
positioning_algorithm: &Box<dyn PositioningAlgorithm>,
display_buffer: &mut DisplayBuffer,
)
fn draw( &mut self, positioning_algorithm: &Box<dyn PositioningAlgorithm>, display_buffer: &mut DisplayBuffer, )
Description Read more
Source§fn get_bounding_box(&self) -> BoundingBox
fn get_bounding_box(&self) -> BoundingBox
Description Read more
Auto Trait Implementations§
impl Freeze for LabelWidget
impl RefUnwindSafe for LabelWidget
impl Send for LabelWidget
impl Sync for LabelWidget
impl Unpin for LabelWidget
impl UnwindSafe for LabelWidget
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