Struct kas_widgets::RadioBox [−][src]
pub struct RadioBox<M: 'static> { /* fields omitted */ }
Expand description
A radiobox with optional label
Implementations
Construct a radiobox with a given label
and handle
RadioBox labels are optional; if no label is desired, use an empty string.
All instances of RadioBoxBare
and RadioBox
constructed over the
same handle
will be considered part of a single group.
Set event handler f
On selection (through user input events or Event::Activate
) the
closure f
is called. The result of f
is converted to
Response::Msg
or Response::Update
and returned to the parent.
No handler is called on deselection, but Response::Update
is returned.
pub fn new_on<T: Into<AccelString>, F>(
label: T,
handle: UpdateHandle,
f: F
) -> Self where
F: Fn(&mut Manager<'_>) -> Option<M> + 'static,
pub fn new_on<T: Into<AccelString>, F>(
label: T,
handle: UpdateHandle,
f: F
) -> Self where
F: Fn(&mut Manager<'_>) -> Option<M> + 'static,
Construct a radiobox with given label
, handle
and event handler f
RadioBox labels are optional; if no label is desired, use an empty string.
All instances of RadioBoxBare
and RadioBox
constructed over the
same handle
will be considered part of a single group.
On selection (through user input events or Event::Activate
) the
closure f
is called. The result of f
is converted to
Response::Msg
or Response::Update
and returned to the parent.
No handler is called on deselection, but Response::Update
is returned.
pub fn new_msg<S: Into<AccelString>>(
label: S,
handle: UpdateHandle,
msg: M
) -> Self where
M: Clone,
pub fn new_msg<S: Into<AccelString>>(
label: S,
handle: UpdateHandle,
msg: M
) -> Self where
M: Clone,
Construct a radiobox with given label
, handle
and payload msg
RadioBox labels are optional; if no label is desired, use an empty string.
All instances of RadioBoxBare
and RadioBox
constructed over the
same handle
will be considered part of a single group.
On selection (through user input events or Event::Activate
) a clone
of msg
is returned to the parent widget via Response::Msg
.
No handler is called on deselection, but Response::Update
is returned.
Set the initial state of the radiobox.
Trait Implementations
Get the number of child widgets
Get a reference to a child widget by index, or None
if the index is
out of bounds. Read more
Mutable variant of get Read more
Record first identifier Read more
Check whether id
is a descendant Read more
Find the child which is an ancestor of this id
, if any Read more
Find the leaf (lowest descendant) with this id
, if any Read more
Find the leaf (lowest descendant) with this id
, if any Read more
Walk through all widgets, calling f
once on each. Read more
Walk through all widgets, calling f
once on each. Read more
Get self as type Any
(mutable)
Get the name of the widget struct
Erase type
Erase type
Get whether the widget is disabled
Set the disabled state of a widget Read more
Set disabled state (chaining) Read more
Construct InputState
Read more
Auto Trait Implementations
impl<M> !RefUnwindSafe for RadioBox<M>
impl<M> !UnwindSafe for RadioBox<M>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more