Skip to main content

SelectBuilder

Struct SelectBuilder 

Source
pub struct SelectBuilder<'a> { /* private fields */ }
Expand description

A button that opens a list of options. Start with select.

Implementations§

Source§

impl<'a> SelectBuilder<'a>

Source

pub fn selected(self, i: usize) -> Self

The chosen option.

Source

pub fn bind(self, i: &'a mut usize) -> Self

Read the choice from i and write a pick back to it.

Source

pub fn disabled(self, on: bool) -> Self

Disabled colours; does not open.

Source

pub fn searchable(self, on: bool) -> Self

A search line on top of the list (default: more options than the list shows).

Source

pub fn within(self, container: Rect) -> Self

Keep the open list inside container (a modal card, a panel).

Source

pub fn style(self, s: SelectStyle) -> Self

The list’s look (e.g. SelectStyle::from_sheet(&sheet, "div.select-list")).

Source

pub fn key(self, k: Option<&'a KeyInput>) -> Self

This frame’s key press, if any (the app forwards unhandled keys).

Source

pub fn build<'c, C: ContentCx<'c>>(self, cx: &mut C) -> Response

Register and draw (the open list paints after the trigger). Response::checked tells whether the list is open after this frame; Response::pressed that the key given to .key was used.

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for SelectBuilder<'a>

§

impl<'a> Freeze for SelectBuilder<'a>

§

impl<'a> RefUnwindSafe for SelectBuilder<'a>

§

impl<'a> Send for SelectBuilder<'a>

§

impl<'a> Sync for SelectBuilder<'a>

§

impl<'a> Unpin for SelectBuilder<'a>

§

impl<'a> UnsafeUnpin for SelectBuilder<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.