[][src]Struct itui::widgets::SelectableList

pub struct SelectableList<'b, MSG> {
    pub events: Vec<Attribute<Event, MSG>>,
    // some fields omitted
}

A widget to display several items among which one can be selected (optional)

Examples

SelectableList::default()
    .block(Block::default().title("SelectableList").borders(Borders::ALL))
    .items(&["Item 1", "Item 2", "Item 3"])
    .select(Some(1))
    .style(Style::default().fg(Color::White))
    .highlight_style(Style::default().modifier(Modifier::ITALIC))
    .highlight_symbol(">>");

Fields

events: Vec<Attribute<Event, MSG>>

events attached to this block

Methods

impl<'b, MSG> SelectableList<'b, MSG>[src]

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

pub fn items<I>(self, items: &'b [I]) -> Self where
    I: AsRef<str> + 'b, 
[src]

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

pub fn highlight_symbol(self, highlight_symbol: &'b str) -> Self[src]

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

pub fn select(self, index: Option<usize>) -> Self[src]

Trait Implementations

impl<'b, MSG> Widget for SelectableList<'b, MSG> where
    MSG: Clone + '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]

impl<'b, MSG> Default for SelectableList<'b, MSG>[src]

Auto Trait Implementations

impl<'b, MSG> !Sync for SelectableList<'b, MSG>

impl<'b, MSG> !Send for SelectableList<'b, MSG>

impl<'b, MSG> Unpin for SelectableList<'b, MSG>

impl<'b, MSG> !RefUnwindSafe for SelectableList<'b, MSG>

impl<'b, MSG> !UnwindSafe for SelectableList<'b, 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]