[−][src]Struct tui::terminal::Frame
Represents a consistent terminal interface for rendering.
Implementations
impl<'a, B> Frame<'a, B> where
B: Backend,
[src]
B: Backend,
pub fn size(&self) -> Rect
[src]
Terminal size, guaranteed not to change when rendering.
pub fn render_widget<W>(&mut self, widget: W, area: Rect) where
W: Widget,
[src]
W: Widget,
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);
pub fn render_stateful_widget<W>(
&mut self,
widget: W,
area: Rect,
state: &mut W::State
) where
W: StatefulWidget,
[src]
&mut self,
widget: W,
area: Rect,
state: &mut W::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);
pub fn set_cursor(&mut self, x: u16, y: u16)
[src]
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,
[src]
B: RefUnwindSafe,
impl<'a, B> Send for Frame<'a, B> where
B: Send,
[src]
B: Send,
impl<'a, B> Sync for Frame<'a, B> where
B: Sync,
[src]
B: Sync,
impl<'a, B> Unpin for Frame<'a, B>
[src]
impl<'a, B> !UnwindSafe for Frame<'a, B>
[src]
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>,