Struct termwiz::widgets::Ui [−][src]
Manages the widgets on the display
Implementations
impl<'widget> Ui<'widget>
[src]
pub fn new() -> Self
[src]
pub fn add<W: Widget + 'widget>(
&mut self,
parent: Option<WidgetId>,
w: W
) -> WidgetId
[src]
&mut self,
parent: Option<WidgetId>,
w: W
) -> WidgetId
pub fn set_root<W: Widget + 'widget>(&mut self, w: W) -> WidgetId
[src]
pub fn add_child<W: Widget + 'widget>(
&mut self,
parent: WidgetId,
w: W
) -> WidgetId
[src]
&mut self,
parent: WidgetId,
w: W
) -> WidgetId
pub fn process_event_queue(&mut self) -> Result<()>
[src]
pub fn queue_event(&mut self, event: WidgetEvent)
[src]
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.
pub fn set_focus(&mut self, id: WidgetId)
[src]
Assign keyboard focus to the specified widget.
pub fn render_to_screen(&mut self, screen: &mut Surface) -> Result<bool>
[src]
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.
pub fn to_screen_coords(
&self,
widget: WidgetId,
coords: &ParentRelativeCoords
) -> ScreenRelativeCoords
[src]
&self,
widget: WidgetId,
coords: &ParentRelativeCoords
) -> ScreenRelativeCoords
Convert coordinates that are relative to widget into coordinates that are relative to the screen origin (top left).
pub fn to_widget_coords(
&self,
widget: WidgetId,
coords: &ScreenRelativeCoords
) -> ParentRelativeCoords
[src]
&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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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.
pub 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>,