pub trait WidgetExt: Widget {
fn id(&self) -> WidgetId { ... }
fn eq_id<T>(&self, rhs: T) -> bool
where
WidgetId: PartialEq<T>,
{ ... }
fn identify(&self) -> IdentifyWidget { ... }
fn is_ancestor_of(&self, id: &WidgetId) -> bool { ... }
fn is_strict_ancestor_of(&self, id: &WidgetId) -> bool { ... }
fn find_widget(&self, id: &WidgetId) -> Option<&dyn Widget> { ... }
fn find_widget_mut(&mut self, id: &WidgetId) -> Option<&mut dyn Widget> { ... }
}Expand description
Extension trait over widgets
Provided Methods
Get the widget’s identifier
Note that the default-constructed WidgetId is invalid: any
operations on this value will cause a panic. Valid identifiers are
assigned by Widget::pre_configure.
Test widget identifier for equality
This method may be used to test against WidgetId, Option<WidgetId>
and Option<&WidgetId>.
sourcefn identify(&self) -> IdentifyWidget
fn identify(&self) -> IdentifyWidget
Display as “StructName#WidgetId”
sourcefn is_ancestor_of(&self, id: &WidgetId) -> bool
fn is_ancestor_of(&self, id: &WidgetId) -> bool
Check whether id is self or a descendant
This function assumes that id is a valid widget.
sourcefn is_strict_ancestor_of(&self, id: &WidgetId) -> bool
fn is_strict_ancestor_of(&self, id: &WidgetId) -> bool
Check whether id is not self and is a descendant
This function assumes that id is a valid widget.
sourcefn find_widget(&self, id: &WidgetId) -> Option<&dyn Widget>
fn find_widget(&self, id: &WidgetId) -> Option<&dyn Widget>
Find the descendant with this id, if any
sourcefn find_widget_mut(&mut self, id: &WidgetId) -> Option<&mut dyn Widget>
fn find_widget_mut(&mut self, id: &WidgetId) -> Option<&mut dyn Widget>
Find the descendant with this id, if any