pub trait Cap: Debug + Sealed {
// Required methods
fn data(&self, widget: Id) -> &dyn Any;
fn children(&self, widget: Id) -> Iter<'_, Id> ⓘ;
fn root_id(&self) -> Id;
fn parent_id(&self, widget: Id) -> Option<Id>;
fn is_visible(&self, widget: Id) -> bool;
fn is_displayed(&self, widget: Id) -> bool;
fn focused(&self) -> Option<Id>;
fn is_focused(&self, widget: Id) -> bool;
}
Expand description
A capability allowing for various widget related operations.
Required Methods§
sourcefn children(&self, widget: Id) -> Iter<'_, Id> ⓘ
fn children(&self, widget: Id) -> Iter<'_, Id> ⓘ
Retrieve an iterator over the children. Iteration happens in z-order, from highest to lowest.
sourcefn is_visible(&self, widget: Id) -> bool
fn is_visible(&self, widget: Id) -> bool
Check whether a widget has its visibility flag set.
Note that a return value of true
does not necessary mean that
the widget is actually visible. A widget is only visible if all
its parents have the visibility flag set, too. The
is_displayed
method can be used to check
for actual visibility.
sourcefn is_displayed(&self, widget: Id) -> bool
fn is_displayed(&self, widget: Id) -> bool
Check whether a widget is actually being displayed.
This method checks whether the referenced widget is actually being displayed, that is, whether its own as well as its parents’ visibility flags are all set.
sourcefn is_focused(&self, widget: Id) -> bool
fn is_focused(&self, widget: Id) -> bool
Check whether the widget with the given Id
is focused.