pub struct Checkbox { /* private fields */ }Expand description
A checkbox widget for boolean selection
Implementations§
Source§impl Checkbox
impl Checkbox
Sourcepub fn style(self, style: CheckboxStyle) -> Self
pub fn style(self, style: CheckboxStyle) -> Self
Set checkbox style
Sourcepub fn is_checked(&self) -> bool
pub fn is_checked(&self) -> bool
Check if checkbox is checked
Sourcepub fn set_checked(&mut self, checked: bool)
pub fn set_checked(&mut self, checked: bool)
Set checked state (mutable)
Sourcepub fn handle_key(&mut self, key: &Key) -> bool
pub fn handle_key(&mut self, key: &Key) -> bool
Handle key input, returns true if state changed
Source§impl Checkbox
impl Checkbox
Sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Check if widget is focused
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Check if widget is disabled
Sourcepub fn set_focused(&mut self, focused: bool)
pub fn set_focused(&mut self, focused: bool)
Set focused state (mutable)
Trait Implementations§
Source§impl Interactive for Checkbox
impl Interactive for Checkbox
Source§fn handle_key(&mut self, event: &KeyEvent) -> EventResult
fn handle_key(&mut self, event: &KeyEvent) -> EventResult
Handle keyboard event Read more
Source§fn handle_mouse(&mut self, event: &MouseEvent, area: Rect) -> EventResult
fn handle_mouse(&mut self, event: &MouseEvent, area: Rect) -> EventResult
Handle mouse event Read more
Source§impl StyledView for Checkbox
impl StyledView for Checkbox
Source§fn remove_class(&mut self, class: &str)
fn remove_class(&mut self, class: &str)
Remove a CSS class
Source§fn toggle_class(&mut self, class: &str)
fn toggle_class(&mut self, class: &str)
Toggle a CSS class
Auto Trait Implementations§
impl Freeze for Checkbox
impl RefUnwindSafe for Checkbox
impl Send for Checkbox
impl Sync for Checkbox
impl Unpin for Checkbox
impl UnsafeUnpin for Checkbox
impl UnwindSafe for Checkbox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more