Trait tui::widgets::Widget

source ·
pub trait Widget {
    fn draw(&mut self, area: Rect, buf: &mut Buffer);

    fn background(&self, area: &Rect, buf: &mut Buffer, color: Color) { ... }
    fn render<B>(&mut self, f: &mut Frame<'_, B>, area: Rect)
    where
        Self: Sized,
        B: Backend
, { ... } }
Expand description

Base requirements for a Widget

Required Methods§

Draws the current state of the widget in the given buffer. That the only method required to implement a custom widget.

Provided Methods§

Helper method to quickly set the background of all cells inside the specified area.

Helper method that can be chained with a widget’s builder methods to render it.

Implementors§