[−][src]Struct cursive::views::RadioGroup
Group to coordinate multiple radio buttons.
A RadioGroup
is used to create and manage RadioButton
s.
A RadioGroup
can be cloned; it will keep pointing to the same group.
Implementations
impl<T> RadioGroup<T> where
T: 'static,
[src]
T: 'static,
pub fn new() -> RadioGroup<T>
[src]
Creates an empty group for radio buttons.
pub fn button<S>(&mut self, value: T, label: S) -> RadioButton<T> where
S: Into<String>,
[src]
S: Into<String>,
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>(&mut self, on_change: F) where
F: 'static + Fn(&mut Cursive, &T),
[src]
F: 'static + Fn(&mut Cursive, &T),
Sets a callback to be used when the selection changes.
pub fn on_change<F>(self, on_change: F) -> RadioGroup<T> where
F: 'static + Fn(&mut Cursive, &T),
[src]
F: 'static + Fn(&mut Cursive, &T),
Sets a callback to be used when the selection changes.
Chainable variant.
impl RadioGroup<String>
[src]
pub fn button_str<S>(&mut self, text: S) -> RadioButton<String> where
S: Into<String>,
[src]
S: Into<String>,
Adds a button, using the label itself as value.
Trait Implementations
impl<T> Clone for RadioGroup<T>
[src]
pub fn clone(&self) -> RadioGroup<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Default for RadioGroup<T> where
T: 'static,
[src]
T: 'static,
pub fn default() -> RadioGroup<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for RadioGroup<T>
[src]
impl<T> !Send for RadioGroup<T>
[src]
impl<T> !Sync for RadioGroup<T>
[src]
impl<T> Unpin for RadioGroup<T>
[src]
impl<T> !UnwindSafe for RadioGroup<T>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> With for T
[src]
pub fn wrap_with<U, F>(self, f: F) -> U where
F: FnOnce(Self) -> U,
[src]
F: FnOnce(Self) -> U,
pub fn with<F>(self, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),
pub fn try_with<E, F>(self, f: F) -> Result<Self, E> where
F: FnOnce(&mut Self) -> Result<(), E>,
[src]
F: FnOnce(&mut Self) -> Result<(), E>,
pub fn with_if<F>(self, condition: bool, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),