Struct kas_widgets::ComboBox [−][src]
pub struct ComboBox<M: 'static> { /* fields omitted */ }
Expand description
A pop-up multiple choice menu
A combobox presents a menu with a fixed set of choices when clicked.
Implementations
Construct a combobox
Constructs a combobox with labels derived from an iterator over string
types, and the chosen active
entry. For example:
let combobox = ComboBox::new(&["zero", "one", "two"], 0);
Construct a combobox with the given menu entries
A combobox presents a menu with a fixed set of choices when clicked,
with the active
choice selected (0-based index).
Set the selection handler f
On selection of a new choice the closure f
is called with the choice’s
index. The result of f
is converted to Response::Msg
or
Response::Update
and returned to the parent.
Get the index of the active choice
This index is normally less than the number of choices (self.len()
),
but may not be if set programmatically or there are no choices.
Set the active choice
Remove all choices
Triggers a reconfigure action.
Add a choice to the combobox, in last position
Triggers a reconfigure action.
Pops the last choice from the combobox
Triggers a reconfigure action.
Removes the choice at position index
Panics if index
is out of bounds.
Triggers a reconfigure action.
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 ComboBox<M>
impl<M> !UnwindSafe for ComboBox<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