Trait lvgl::Widget

source ·
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§

source

fn from_raw(raw_pointer: NonNull<lv_obj_t>) -> Self

Construct an instance of the object from a raw pointer.

Provided Methods§

source

fn add_style(&mut self, part: Self::Part, style: &mut Style) -> LvResult<()>

Adds a Style to a given widget.

source

fn set_pos(&mut self, x: i16, y: i16) -> LvResult<()>

Sets a widget’s position relative to its parent.

source

fn set_size(&mut self, w: i16, h: i16) -> LvResult<()>

Sets a widget’s size. Alternatively, use set_width() and set_height().

source

fn set_width(&mut self, w: u32) -> LvResult<()>

Sets a widget’s width. Alternatively, use set_size().

source

fn set_height(&mut self, h: u32) -> LvResult<()>

Sets a widget’s height. Alternatively, use set_size().

source

fn set_align(&mut self, align: Align, x_mod: i32, y_mod: i32) -> LvResult<()>

Sets a widget’s align relative to its parent along with an offset.

Implementors§

source§

impl Widget for Obj

source§

impl Widget for Animimg

source§

impl Widget for Arc

source§

impl Widget for Bar

source§

impl Widget for Btn

source§

impl Widget for Btnmatrix

source§

impl Widget for Calendar

source§

impl Widget for Canvas

source§

impl Widget for Chart

source§

impl Widget for Checkbox

source§

impl Widget for Dropdown

source§

impl Widget for Img

source§

impl Widget for Imgbtn

source§

impl Widget for Keyboard

source§

impl Widget for Label

source§

impl Widget for Led

source§

impl Widget for Line

source§

impl Widget for List

source§

impl Widget for Menu

source§

impl Widget for Meter

source§

impl Widget for Roller

source§

impl Widget for Slider

source§

impl Widget for Spangroup

source§

impl Widget for Spinbox

source§

impl Widget for Switch

source§

impl Widget for Table

source§

impl Widget for Textarea

source§

impl Widget for Tileview