Struct termwiz::widgets::Ui[][src]

pub struct Ui<'widget> { /* fields omitted */ }

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]

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]

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]

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]

Convert coordinates that are relative to the screen origin (top left) into coordinates that are relative to the widget.

Trait Implementations

impl<'widget> Default for Ui<'widget>[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.