[−][src]Struct gui::Ui
A Ui
is a container for related widgets.
Methods
impl<E> Ui<E> where
E: 'static + Debug,
[src]
E: 'static + Debug,
pub fn new(
new_root_widget: &'f mut dyn FnMut(Id, &mut dyn MutCap<E>) -> Box<dyn Widget<E>>
) -> (Self, Id)
[src]
new_root_widget: &'f mut dyn FnMut(Id, &mut dyn MutCap<E>) -> Box<dyn Widget<E>>
) -> (Self, Id)
Create a new Ui
instance containing one widget that acts as the
root widget.
pub fn render(&self, renderer: &dyn Renderer)
[src]
Render the Ui
with the given Renderer
.
pub fn handle<T>(&mut self, event: T) -> Option<UnhandledEvents<E>> where
T: Into<UiEvent<E>>,
[src]
T: Into<UiEvent<E>>,
Handle an event.
This function performs the initial determination of which widget is supposed to handle the given event and then passes it down to the actual event handler.
Trait Implementations
impl<E> Cap for Ui<E> where
E: 'static + Debug,
[src]
E: 'static + Debug,
fn children(&self, widget: Id) -> Iter<'widget, Id>
[src]
Retrieve an iterator over the children. Iteration happens in z-order, from highest to lowest.
fn root_id(&self) -> Id
[src]
Retrieve the Id
of the root widget.
fn parent_id(&self, widget: Id) -> Option<Id>
[src]
Retrieve the parent of the given widget.
fn is_visible(&self, widget: Id) -> bool
[src]
Check whether a widget has its visibility flag set.
fn is_displayed(&self, widget: Id) -> bool
[src]
Check whether a widget is actually being displayed.
fn focused(&self) -> Option<Id>
[src]
Retrieve the currently focused widget.
fn is_focused(&self, widget: Id) -> bool
[src]
Check whether the given widget is focused.
impl<E> MutCap<E> for Ui<E> where
E: 'static + Debug,
[src]
E: 'static + Debug,
fn add_widget(
&mut self,
parent: Id,
new_widget: &'f mut dyn FnMut(Id, &mut dyn MutCap<E>) -> Box<dyn Widget<E>>
) -> Id
[src]
&mut self,
parent: Id,
new_widget: &'f mut dyn FnMut(Id, &mut dyn MutCap<E>) -> Box<dyn Widget<E>>
) -> Id
Add a widget to the Ui
.
fn show(&mut self, widget: Id)
[src]
Show a widget, i.e., set its and its parents' visibility flag.
fn hide(&mut self, widget: Id)
[src]
Hide a widget, i.e., unset its visibility flag.
fn focus(&mut self, widget: Id)
[src]
Focus a widget.
fn hook_events(
&mut self,
widget: Id,
hook_fn: Option<&'static dyn Fn(&mut dyn Widget<E>, &E, &dyn Cap) -> Option<UiEvents<E>>>
) -> Option<&'static dyn Fn(&mut dyn Widget<E>, &E, &dyn Cap) -> Option<UiEvents<E>>>
[src]
&mut self,
widget: Id,
hook_fn: Option<&'static dyn Fn(&mut dyn Widget<E>, &E, &dyn Cap) -> Option<UiEvents<E>>>
) -> Option<&'static dyn Fn(&mut dyn Widget<E>, &E, &dyn Cap) -> Option<UiEvents<E>>>
Install or remove an event hook handler.
impl<E: Default> Default for Ui<E> where
E: 'static + Debug,
[src]
E: 'static + Debug,
impl<E: Debug> Debug for Ui<E> where
E: 'static + Debug,
[src]
E: 'static + Debug,
Auto Trait Implementations
impl<E> !Send for Ui<E>
impl<E> !Sync for Ui<E>
impl<E> Unpin for Ui<E>
impl<E> !UnwindSafe for Ui<E>
impl<E> !RefUnwindSafe for Ui<E>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,