[][src]Trait tui_temp_fork::widgets::Widget

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
, { ... } }

Base requirements for a Widget

Required methods

fn draw(&mut self, area: Rect, buf: &mut Buffer)

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

Loading content...

Provided methods

fn background(&self, area: Rect, buf: &mut Buffer, color: Color)

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

fn render<B>(&mut self, f: &mut Frame<B>, area: Rect) where
    Self: Sized,
    B: Backend

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

Loading content...

Implementors

impl<'a> Widget for BarChart<'a>[src]

impl<'a> Widget for Block<'a>[src]

impl<'a> Widget for Gauge<'a>[src]

impl<'a> Widget for Sparkline<'a>[src]

impl<'a, 't, 'b, T> Widget for Paragraph<'a, 't, T> where
    T: Iterator<Item = &'t Text<'t>>, 
[src]

impl<'a, F> Widget for Canvas<'a, F> where
    F: Fn(&mut Context), 
[src]

impl<'a, LX, LY> Widget for Chart<'a, LX, LY> where
    LX: AsRef<str>,
    LY: AsRef<str>, 
[src]

impl<'a, T> Widget for Tabs<'a, T> where
    T: AsRef<str>, 
[src]

impl<'a, T, H, I, D, R> Widget for Table<'a, T, H, I, D, R> where
    T: Display,
    H: Iterator<Item = T>,
    I: Display,
    D: Iterator<Item = I>,
    R: Iterator<Item = Row<D, I>>, 
[src]

impl<'b> Widget for SelectableList<'b>[src]

impl<'b, L> Widget for List<'b, L> where
    L: Iterator<Item = Text<'b>>, 
[src]

Loading content...