Struct tuirealm::tui::Frame [−][src]
pub struct Frame<'a, B> where
B: 'a + Backend, { /* fields omitted */ }
Expand description
Represents a consistent terminal interface for rendering.
Implementations
Render a Widget
to the current buffer using Widget::render
.
Examples
let block = Block::default(); let area = Rect::new(0, 0, 5, 5); let mut frame = terminal.get_frame(); frame.render_widget(block, area);Run
pub fn render_stateful_widget<W>(
&mut self,
widget: W,
area: Rect,
state: &mut <W as StatefulWidget>::State
) where
W: StatefulWidget,
pub fn render_stateful_widget<W>(
&mut self,
widget: W,
area: Rect,
state: &mut <W as StatefulWidget>::State
) where
W: StatefulWidget,
Render a StatefulWidget
to the current buffer using StatefulWidget::render
.
The last argument should be an instance of the StatefulWidget::State
associated to the
given StatefulWidget
.
Examples
let mut state = ListState::default(); state.select(Some(1)); let items = vec![ ListItem::new("Item 1"), ListItem::new("Item 2"), ]; let list = List::new(items); let area = Rect::new(0, 0, 5, 5); let mut frame = terminal.get_frame(); frame.render_stateful_widget(list, area, &mut state);Run
After drawing this frame, make the cursor visible and put it at the specified (x, y) coordinates. If this method is not called, the cursor will be hidden.
Note that this will interfere with calls to Terminal::hide_cursor()
,
Terminal::show_cursor()
, and Terminal::set_cursor()
. Pick one of the APIs and stick
with it.
Auto Trait Implementations
impl<'a, B> RefUnwindSafe for Frame<'a, B> where
B: RefUnwindSafe,
impl<'a, B> !UnwindSafe for Frame<'a, B>