[][src]Struct cursive::views::Checkbox

pub struct Checkbox { /* fields omitted */ }

Checkable box.

Methods

impl Checkbox[src]

pub fn disable(&mut self)[src]

Disables this view.

A disabled view cannot be selected.

pub fn disabled(self) -> Self[src]

Disables this view.

Chainable variant.

pub fn enable(&mut self)[src]

Re-enables this view.

pub fn set_enabled(&mut self, enabled: bool)[src]

Enable or disable this view.

pub fn is_enabled(&self) -> bool[src]

Returns true if this view is enabled.

pub fn new() -> Self[src]

Creates a new, unchecked checkbox.

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

Sets a callback to be used when the state changes.

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

Sets a callback to be used when the state changes.

Chainable variant.

pub fn toggle(&mut self) -> EventResult[src]

Toggles the checkbox state.

pub fn check(&mut self) -> EventResult[src]

Check the checkbox.

pub fn checked(self) -> Self[src]

Check the checkbox.

Chainable variant.

pub fn is_checked(&self) -> bool[src]

Returns true if the checkbox is checked.

pub fn uncheck(&mut self) -> EventResult[src]

Uncheck the checkbox.

pub fn unchecked(self) -> Self[src]

Uncheck the checkbox.

Chainable variant.

pub fn set_checked(&mut self, checked: bool) -> EventResult[src]

Sets the checkbox state.

Trait Implementations

impl View for Checkbox[src]

fn layout(&mut self, _: Vec2)[src]

Called once the size for this view has been decided. Read more

fn needs_relayout(&self) -> bool[src]

Should return true if the view content changed since the last call to layout(). Read more

fn call_on_any<'a>(&mut self, _: &Selector, _: AnyCb<'a>)[src]

Runs a closure on the view identified by the given selector. Read more

fn focus_view(&mut self, _: &Selector) -> Result<(), ()>[src]

Moves the focus to the view identified by the given selector. Read more

fn important_area(&self, view_size: Vec2) -> Rect[src]

What part of the view is important and should be visible? Read more

impl Default for Checkbox[src]

Auto Trait Implementations

impl Unpin for Checkbox

impl !Sync for Checkbox

impl !Send for Checkbox

impl !UnwindSafe for Checkbox

impl !RefUnwindSafe for Checkbox

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T[src]