pub trait Widget: NativeObject {
type SpecialEvent;
type Part: Into<lv_part_t>;
// Required method
fn from_raw(raw_pointer: NonNull<lv_obj_t>) -> Self;
// Provided methods
fn add_style(&mut self, part: Self::Part, style: &mut Style) -> LvResult<()> { ... }
fn set_pos(&mut self, x: i16, y: i16) -> LvResult<()> { ... }
fn set_size(&mut self, w: i16, h: i16) -> LvResult<()> { ... }
fn set_width(&mut self, w: u32) -> LvResult<()> { ... }
fn set_height(&mut self, h: u32) -> LvResult<()> { ... }
fn set_align(
&mut self,
align: Align,
x_mod: i32,
y_mod: i32,
) -> LvResult<()> { ... }
}Expand description
A wrapper for all LVGL common operations on generic objects.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn add_style(&mut self, part: Self::Part, style: &mut Style) -> LvResult<()>
fn add_style(&mut self, part: Self::Part, style: &mut Style) -> LvResult<()>
Adds a Style to a given widget.
Sourcefn set_pos(&mut self, x: i16, y: i16) -> LvResult<()>
fn set_pos(&mut self, x: i16, y: i16) -> LvResult<()>
Sets a widget’s position relative to its parent.
Sourcefn set_size(&mut self, w: i16, h: i16) -> LvResult<()>
fn set_size(&mut self, w: i16, h: i16) -> LvResult<()>
Sets a widget’s size. Alternatively, use set_width() and set_height().
Sourcefn set_width(&mut self, w: u32) -> LvResult<()>
fn set_width(&mut self, w: u32) -> LvResult<()>
Sets a widget’s width. Alternatively, use set_size().
Sourcefn set_height(&mut self, h: u32) -> LvResult<()>
fn set_height(&mut self, h: u32) -> LvResult<()>
Sets a widget’s height. Alternatively, use set_size().
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.