pub struct Ui<'widget> { /* private fields */ }
Expand description
Manages the widgets on the display
Implementations
sourceimpl<'widget> Ui<'widget>
impl<'widget> Ui<'widget>
pub fn new() -> Self
pub fn add<W: Widget + 'widget>(
&mut self,
parent: Option<WidgetId>,
w: W
) -> WidgetId
pub fn set_root<W: Widget + 'widget>(&mut self, w: W) -> WidgetId
pub fn add_child<W: Widget + 'widget>(
&mut self,
parent: WidgetId,
w: W
) -> WidgetId
pub fn process_event_queue(&mut self) -> Result<()>
sourcepub fn queue_event(&mut self, event: WidgetEvent)
pub fn queue_event(&mut self, event: WidgetEvent)
Queue up an event. Events are processed by the appropriate
Widget::update_state
method. Events may be re-processed to
simplify handling for widgets. eg: a TODO: is to synthesize double
and triple click events.
sourcepub fn render_to_screen(&mut self, screen: &mut Surface) -> Result<bool>
pub fn render_to_screen(&mut self, screen: &mut Surface) -> Result<bool>
Apply the current state of the widgets to the screen. This has the side effect of clearing out any unconsumed input queue. Returns true if the Ui may need to be updated again; for example, if the most recent update operation changed layout.
sourcepub fn to_screen_coords(
&self,
widget: WidgetId,
coords: &ParentRelativeCoords
) -> ScreenRelativeCoords
pub fn to_screen_coords(
&self,
widget: WidgetId,
coords: &ParentRelativeCoords
) -> ScreenRelativeCoords
Convert coordinates that are relative to widget into coordinates that are relative to the screen origin (top left).
sourcepub fn to_widget_coords(
&self,
widget: WidgetId,
coords: &ScreenRelativeCoords
) -> ParentRelativeCoords
pub fn to_widget_coords(
&self,
widget: WidgetId,
coords: &ScreenRelativeCoords
) -> ParentRelativeCoords
Convert coordinates that are relative to the screen origin (top left) into coordinates that are relative to the widget.
Trait Implementations
Auto Trait Implementations
impl<'widget> !RefUnwindSafe for Ui<'widget>
impl<'widget> !Send for Ui<'widget>
impl<'widget> !Sync for Ui<'widget>
impl<'widget> Unpin for Ui<'widget>
impl<'widget> !UnwindSafe for Ui<'widget>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more