pub struct Checkbox { /* private fields */ }Expand description
A box that can be checked, followed by its children in a row.
The box itself is a child element with the tag check, so it is styled
like anything else: checkbox:checked > check { background-color: ... }.
Fires toggle with the new state on click or Space.
Implementations§
Trait Implementations§
Source§impl<M: 'static> Widget<M> for Checkbox
impl<M: 'static> Widget<M> for Checkbox
Source§fn set_attribute(&mut self, name: &str, value: &str) -> bool
fn set_attribute(&mut self, name: &str, value: &str) -> bool
Takes an attribute from the element description, returning
false
for one the widget does not know. id, class, style, grow,
align, disabled, shortcut and state never reach here.Source§fn axis(&self) -> Option<Axis>
fn axis(&self) -> Option<Axis>
Some for a container: the direction it lays its children out in.Source§fn state(&self) -> ElementState
fn state(&self) -> ElementState
State the widget owns, such as
CHECKED, merged into the element’s
state for styling.Source§fn event(&mut self, cx: &mut EventCx<'_, M>, event: &Event) -> bool
fn event(&mut self, cx: &mut EventCx<'_, M>, event: &Event) -> bool
Handles an event aimed at this element. Returning
true stops the
event from bubbling to the parent.fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
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