[][src]Struct cursive::views::RadioGroup

pub struct RadioGroup<T> { /* fields omitted */ }

Group to coordinate multiple radio buttons.

A RadioGroup is used to create and manage RadioButtons.

A RadioGroup can be cloned; it will keep pointing to the same group.

Methods

impl<T: 'static> RadioGroup<T>[src]

pub fn new() -> Self[src]

Creates an empty group for radio buttons.

pub fn button<S: Into<String>>(&mut self, value: T, label: S) -> RadioButton<T>[src]

Adds a new button to the group.

The button will display label next to it, and will embed value.

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

Returns the id of the selected button.

Buttons are indexed in the order they are created, starting from 0.

pub fn selection(&self) -> Rc<T>[src]

Returns the value associated with the selected button.

pub fn set_on_change<F: 'static + Fn(&mut Cursive, &T)>(&mut self, on_change: F)[src]

Sets a callback to be used when the selection changes.

pub fn on_change<F: 'static + Fn(&mut Cursive, &T)>(self, on_change: F) -> Self[src]

Sets a callback to be used when the selection changes.

Chainable variant.

impl RadioGroup<String>[src]

pub fn button_str<S: Into<String>>(&mut self, text: S) -> RadioButton<String>[src]

Adds a button, using the label itself as value.

Trait Implementations

impl<T: Clone> Clone for RadioGroup<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: 'static> Default for RadioGroup<T>[src]

Auto Trait Implementations

impl<T> !Sync for RadioGroup<T>

impl<T> !Send for RadioGroup<T>

impl<T> Unpin for RadioGroup<T>

impl<T> !RefUnwindSafe for RadioGroup<T>

impl<T> !UnwindSafe for RadioGroup<T>

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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]

impl<T> Erased for T[src]