pub struct Checkbox { /* private fields */ }
Expand description
Checkbox
Checkboxes are used for multiple choices, not for mutually exclusive choices. Each checkbox works independently from other checkboxes in the list, therefore checking an additional box does not affect any other selections.
Implementations§
source§impl Checkbox
impl Checkbox
pub fn new(id: impl Into<ElementId>, checked: Selection) -> Self
pub fn disabled(self, disabled: bool) -> Self
pub fn on_click( self, handler: impl 'static + Fn(&Selection, &mut WindowContext<'_>) + Send + Sync ) -> Self
pub fn render(self, cx: &mut WindowContext<'_>) -> impl Element
Trait Implementations§
source§impl RenderOnce for Checkbox
impl RenderOnce for Checkbox
type Element = CompositeElement<Checkbox>
fn element_id(&self) -> Option<ElementId>
fn render_once(self) -> Self::Element
fn render_into_any(self) -> AnyElement
fn draw<T, R>( self, origin: Point<Pixels>, available_space: Size<T>, cx: &mut WindowContext<'_>, f: impl FnOnce(&mut <Self::Element as Element>::State, &mut WindowContext<'_>) -> R ) -> Rwhere T: Clone + Default + Debug + Into<AvailableSpace>,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere Self: Sized, U: RenderOnce,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere Self: Sized,
fn when_some<T>( self, option: Option<T>, then: impl FnOnce(Self, T) -> Self ) -> Selfwhere Self: Sized,
Auto Trait Implementations§
impl !RefUnwindSafe for Checkbox
impl !Send for Checkbox
impl !Sync for Checkbox
impl Unpin 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