Struct tui::widgets::Paragraph [−][src]
A widget to display some text.
Examples
let text = [ Text::raw("First line\n"), Text::styled("Second line\n", Style::default().fg(Color::Red)) ]; Paragraph::new(text.iter()) .block(Block::default().title("Paragraph").borders(Borders::ALL)) .style(Style::default().fg(Color::White).bg(Color::Black)) .alignment(Alignment::Center) .wrap(true);
Methods
impl<'a, 't, T> Paragraph<'a, 't, T> where
T: Iterator<Item = &'t Text<'t>>,
[src]
impl<'a, 't, T> Paragraph<'a, 't, T> where
T: Iterator<Item = &'t Text<'t>>,
pub fn new(text: T) -> Paragraph<'a, 't, T>
[src]
pub fn new(text: T) -> Paragraph<'a, 't, T>
pub fn block(self, block: Block<'a>) -> Paragraph<'a, 't, T>
[src]
pub fn block(self, block: Block<'a>) -> Paragraph<'a, 't, T>
pub fn style(self, style: Style) -> Paragraph<'a, 't, T>
[src]
pub fn style(self, style: Style) -> Paragraph<'a, 't, T>
pub fn wrap(self, flag: bool) -> Paragraph<'a, 't, T>
[src]
pub fn wrap(self, flag: bool) -> Paragraph<'a, 't, T>
pub fn raw(self, flag: bool) -> Paragraph<'a, 't, T>
[src]
pub fn raw(self, flag: bool) -> Paragraph<'a, 't, T>
pub fn scroll(self, offset: u16) -> Paragraph<'a, 't, T>
[src]
pub fn scroll(self, offset: u16) -> Paragraph<'a, 't, T>
pub fn alignment(self, alignment: Alignment) -> Paragraph<'a, 't, T>
[src]
pub fn alignment(self, alignment: Alignment) -> Paragraph<'a, 't, T>
Trait Implementations
impl<'a, 't, T> Widget for Paragraph<'a, 't, T> where
T: Iterator<Item = &'t Text<'t>>,
[src]
impl<'a, 't, T> Widget for Paragraph<'a, 't, T> where
T: Iterator<Item = &'t Text<'t>>,
fn draw(&mut self, area: Rect, buf: &mut Buffer)
[src]
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. Read more
fn background(&self, area: &Rect, buf: &mut Buffer, color: Color)
[src]
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,
[src]
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.