[][src]Struct itui::widgets::Paragraph

pub struct Paragraph<'a, 't, T, MSG> where
    T: Iterator<Item = &'t Text<'t>>, 
{ pub events: Vec<Attribute<Event, MSG>>, // some fields omitted }

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);

Fields

events: Vec<Attribute<Event, MSG>>

events attached to this block

Methods

impl<'a, 't, T, MSG> Paragraph<'a, 't, T, MSG> where
    T: Iterator<Item = &'t Text<'t>>,
    MSG: 'static, 
[src]

pub fn new(text: T) -> Self[src]

pub fn block(self, block: Block<'a, MSG>) -> Self[src]

pub fn style(self, style: Style) -> Self[src]

pub fn wrap(self, flag: bool) -> Self[src]

pub fn raw(self, flag: bool) -> Self[src]

pub fn scroll(self, offset: u16) -> Self[src]

pub fn alignment(self, alignment: Alignment) -> Self[src]

pub fn area(self, area: Rect) -> Self[src]

pub fn triggers_event(&self, event: &Event) -> Option<&Callback<Event, MSG>>[src]

Trait Implementations

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

fn background(&self, 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, f: &mut Frame<B>) where
    Self: Sized,
    B: Backend
[src]

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

fn top(&self) -> u16[src]

fn bottom(&self) -> u16[src]

fn left(&self) -> u16[src]

fn right(&self) -> u16[src]

Auto Trait Implementations

impl<'a, 't, T, MSG> !Sync for Paragraph<'a, 't, T, MSG>

impl<'a, 't, T, MSG> !Send for Paragraph<'a, 't, T, MSG>

impl<'a, 't, T, MSG> Unpin for Paragraph<'a, 't, T, MSG> where
    T: Unpin

impl<'a, 't, T, MSG> !RefUnwindSafe for Paragraph<'a, 't, T, MSG>

impl<'a, 't, T, MSG> !UnwindSafe for Paragraph<'a, 't, T, MSG>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]