Struct tui::widgets::Paragraph
[−]
[src]
pub struct Paragraph<'a> { /* fields omitted */ }
A widget to display some text. You can specify colors using commands embedded in the text such as "{[color] [text]}".
Examples
Paragraph::default() .block(Block::default().title("Paragraph").borders(Borders::ALL)) .style(Style::default().fg(Color::White).bg(Color::Black)) .wrap(true) .text("First line\nSecond line\n{red Colored text}.");
Methods
impl<'a> Paragraph<'a>
[src]
pub fn block(&'a mut self, block: Block<'a>) -> &mut Paragraph<'a>
[src]
pub fn text(&mut self, text: &'a str) -> &mut Paragraph<'a>
[src]
pub fn style(&mut self, style: Style) -> &mut Paragraph<'a>
[src]
pub fn wrap(&mut self, flag: bool) -> &mut Paragraph<'a>
[src]
pub fn raw(&mut self, flag: bool) -> &mut Paragraph<'a>
[src]
pub fn scroll(&mut self, offset: u16) -> &mut Paragraph<'a>
[src]
Trait Implementations
impl<'a> Default for Paragraph<'a>
[src]
impl<'a> Widget for Paragraph<'a>
[src]
fn draw(&mut self, area: &Rect, buf: &mut Buffer)
[src]
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]
Helper method to quickly set the background of all cells inside the specified area.
fn render<B>(&mut self, t: &mut Terminal<B>, area: &Rect) where
Self: Sized,
B: Backend,
[src]
Self: Sized,
B: Backend,
Helper method that can be chained with a widget's builder methods to render it.