[][src]Struct penrose::draw::widget::LinesWithSelection

pub struct LinesWithSelection { /* fields omitted */ }

A set of lines that highlights the currently selected line.

Implementations

impl LinesWithSelection[src]

pub fn new(
    font: String,
    point_size: i32,
    padding: f64,
    bg: Color,
    fg: Color,
    bg_sel: Color,
    fg_sel: Color,
    n_lines: usize,
    greedy: bool
) -> Self
[src]

Construct a new LinesWithSelection

pub fn set_input(&mut self, lines: Vec<String>) -> Result<()>[src]

Set the displayed lines and selected index.

pub fn set_selected(&mut self, selected: usize) -> Result<()>[src]

Set the currently selected index

Errors

Fails if the provided index is out of bounds

pub fn set_n_lines(&mut self, n_lines: usize)[src]

Set the maximum number of lines from the input that will be displayed.

Defaults to 10

pub fn selected(&self) -> Option<&str>[src]

The currently selected line (if there is one)

pub fn selected_index(&self) -> usize[src]

The currently selected index

Trait Implementations

impl Clone for LinesWithSelection[src]

impl Debug for LinesWithSelection[src]

impl<X> Hook<X> for LinesWithSelection where
    X: XConn
[src]

impl KeyboardControlled for LinesWithSelection[src]

impl PartialEq<LinesWithSelection> for LinesWithSelection[src]

impl StructuralPartialEq for LinesWithSelection[src]

impl Widget for LinesWithSelection[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<X, T> HookableWidget<X> for T where
    T: Hook<X> + Widget,
    X: XConn
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.