pub struct Obj { /* private fields */ }Expand description
Non-owning handle to an LVGL object (lv_obj_t *).
LVGL manages object lifetimes (parent owns children). No Drop.
Copy enables fluent method chaining (self -> Self).
Implementations§
Source§impl Obj
impl Obj
Sourcepub unsafe fn from_raw(raw: *mut lv_obj_t) -> Self
pub unsafe fn from_raw(raw: *mut lv_obj_t) -> Self
Wrap a raw LVGL object pointer.
§Safety
The pointer must be valid and obtained from an LVGL function.
Sourcepub fn child_count(self) -> u32
pub fn child_count(self) -> u32
Get number of children.
Sourcepub fn get_height(self) -> i32
pub fn get_height(self) -> i32
Get current height.
Sourcepub fn set_user_data(self, data: *mut c_void) -> Self
pub fn set_user_data(self, data: *mut c_void) -> Self
Set user data pointer.
Sourcepub fn get_user_data(self) -> *mut c_void
pub fn get_user_data(self) -> *mut c_void
Get user data pointer.
Sourcepub fn remove_style_all(self) -> Self
pub fn remove_style_all(self) -> Self
Remove all inline and reused styles from this object.
Sourcepub fn get_child(self, idx: i32) -> Obj
pub fn get_child(self, idx: i32) -> Obj
Get the nth child (0-indexed). Returns an Obj wrapping the
LVGL pointer — may be null if out of range (check before using).
Sourcepub fn set_pos(self, x: i32, y: i32)
pub fn set_pos(self, x: i32, y: i32)
Set the position of the widget (legacy, non-fluent variant).
Sourcepub fn set_style_bg_color(self, color: Color, selector: u32)
pub fn set_style_bg_color(self, color: Color, selector: u32)
Set the background color for the given selector (legacy, non-fluent variant).
Sourcepub fn set_style_text_color(self, color: Color, selector: u32)
pub fn set_style_text_color(self, color: Color, selector: u32)
Set the text color for the given selector (legacy, non-fluent variant).
Sourcepub fn set_style_radius(self, radius: i32, selector: u32)
pub fn set_style_radius(self, radius: i32, selector: u32)
Set the corner radius for the given selector (legacy, non-fluent variant).
Sourcepub fn set_style_text_font(self, font: *const lv_font_t, selector: u32)
pub fn set_style_text_font(self, font: *const lv_font_t, selector: u32)
Set the text font for the given selector (legacy, non-fluent variant).
Trait Implementations§
impl Copy for Obj
impl Send for Obj
impl Sync for Obj
Auto Trait Implementations§
impl Freeze for Obj
impl RefUnwindSafe for Obj
impl Unpin for Obj
impl UnsafeUnpin for Obj
impl UnwindSafe for Obj
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EventTarget for Twhere
T: Widget,
impl<T> EventTarget for Twhere
T: Widget,
Source§fn on_fn(self, code: lv_event_code_t, handler: fn(EventCtx<'_>)) -> Self
fn on_fn(self, code: lv_event_code_t, handler: fn(EventCtx<'_>)) -> Self
Source§fn on_clicked(self, handler: fn(EventCtx<'_>)) -> Self
fn on_clicked(self, handler: fn(EventCtx<'_>)) -> Self
Source§fn on_value_change(self, handler: fn(EventCtx<'_>)) -> Self
fn on_value_change(self, handler: fn(EventCtx<'_>)) -> Self
Source§fn on_with<T: Send + Sync + 'static>(
self,
code: lv_event_code_t,
handler: &'static EventHandler<T>,
) -> Self
fn on_with<T: Send + Sync + 'static>( self, code: lv_event_code_t, handler: &'static EventHandler<T>, ) -> Self
InitCell and an EventCtx.Source§fn on_clicked_with<T: Send + Sync + 'static>(
self,
handler: &'static EventHandler<T>,
) -> Self
fn on_clicked_with<T: Send + Sync + 'static>( self, handler: &'static EventHandler<T>, ) -> Self
EventTarget::on_with).Source§fn on_value_change_with<T: Send + Sync + 'static>(
self,
handler: &'static EventHandler<T>,
) -> Self
fn on_value_change_with<T: Send + Sync + 'static>( self, handler: &'static EventHandler<T>, ) -> Self
EventTarget::on_with).Source§impl<T> Layout for Twhere
T: Widget,
impl<T> Layout for Twhere
T: Widget,
Source§fn pos(self, x: i32, y: i32) -> Self
fn pos(self, x: i32, y: i32) -> Self
Source§fn align(self, a: u8, x_ofs: i32, y_ofs: i32) -> Self
fn align(self, a: u8, x_ofs: i32, y_ofs: i32) -> Self
Source§fn add_flag(self, f: u32) -> Self
fn add_flag(self, f: u32) -> Self
LV_OBJ_FLAG_* values).Source§fn remove_flag(self, f: u32) -> Self
fn remove_flag(self, f: u32) -> Self
Source§fn add_state(self, s: u32) -> Self
fn add_state(self, s: u32) -> Self
LV_STATE_CHECKED).Source§fn remove_state(self, s: u32) -> Self
fn remove_state(self, s: u32) -> Self
Source§fn grid_dsc(self, cols: &'static [i32], rows: &'static [i32]) -> Self
fn grid_dsc(self, cols: &'static [i32], rows: &'static [i32]) -> Self
Source§fn grid_cell(
self,
col_align: u32,
col_pos: i32,
col_span: i32,
row_align: u32,
row_pos: i32,
row_span: i32,
) -> Self
fn grid_cell( self, col_align: u32, col_pos: i32, col_span: i32, row_align: u32, row_pos: i32, row_span: i32, ) -> Self
Source§fn flex_flow(self, flow: FlexFlow) -> Self
fn flex_flow(self, flow: FlexFlow) -> Self
Source§fn flex_align(self, main: FlexAlign, cross: FlexAlign, track: FlexAlign) -> Self
fn flex_align(self, main: FlexAlign, cross: FlexAlign, track: FlexAlign) -> Self
lv_obj_set_flex_align.Source§fn layout(self, kind: LayoutKind) -> Self
fn layout(self, kind: LayoutKind) -> Self
Source§fn scroll_to_y(self, y: i32, anim: bool) -> Self
fn scroll_to_y(self, y: i32, anim: bool) -> Self
anim enables animation.Source§fn update_layout(self) -> Self
fn update_layout(self) -> Self
Source§fn content_width(self) -> i32
fn content_width(self) -> i32
Source§fn scroll_bottom(self) -> i32
fn scroll_bottom(self) -> i32
Source§impl<T> Styleable for Twhere
T: Widget,
impl<T> Styleable for Twhere
T: Widget,
Source§fn bg_opa(self, opa: u8) -> Self
fn bg_opa(self, opa: u8) -> Self
Source§fn border_color(self, c: Color) -> Self
fn border_color(self, c: Color) -> Self
Source§fn border_width(self, w: i32) -> Self
fn border_width(self, w: i32) -> Self
Source§fn radius(self, r: i32) -> Self
fn radius(self, r: i32) -> Self
LV_RADIUS_CIRCLE for a pill shape).Source§fn pad_bottom(self, p: i32) -> Self
fn pad_bottom(self, p: i32) -> Self
Source§fn text_color(self, c: Color) -> Self
fn text_color(self, c: Color) -> Self
Source§fn text_font(self, f: *const lv_font_t) -> Self
fn text_font(self, f: *const lv_font_t) -> Self
font_montserrat_32 or font_montserrat_14 for built-ins.Source§fn translate_y(self, v: i32, selector: u32) -> Self
fn translate_y(self, v: i32, selector: u32) -> Self
Source§fn margin_top(self, v: i32, selector: u32) -> Self
fn margin_top(self, v: i32, selector: u32) -> Self
Source§fn margin_bottom(self, v: i32, selector: u32) -> Self
fn margin_bottom(self, v: i32, selector: u32) -> Self
Source§fn margin_left(self, v: i32, selector: u32) -> Self
fn margin_left(self, v: i32, selector: u32) -> Self
Source§fn margin_right(self, v: i32, selector: u32) -> Self
fn margin_right(self, v: i32, selector: u32) -> Self
Source§fn max_height(self, v: i32, selector: u32) -> Self
fn max_height(self, v: i32, selector: u32) -> Self
set_height/content sizing).Source§fn arc_opa(self, opa: u8, selector: u32) -> Self
fn arc_opa(self, opa: u8, selector: u32) -> Self
Source§fn arc_rounded(self, rounded: bool, selector: u32) -> Self
fn arc_rounded(self, rounded: bool, selector: u32) -> Self
Source§fn opa_layered(self, opa: u8, selector: u32) -> Self
fn opa_layered(self, opa: u8, selector: u32) -> Self
Source§fn text_align(self, align: u32, selector: u32) -> Self
fn text_align(self, align: u32, selector: u32) -> Self
TEXT_ALIGN_*) for the given selector.