Struct dotrix_egui::ComboBox[][src]

pub struct ComboBox { /* fields omitted */ }
Expand description

A drop-down selection menu with a descriptive label.

egui::ComboBox::from_label( "Select one!")
    .selected_text(format!("{:?}", selected))
    .show_ui(ui, |ui| {
        ui.selectable_value(&mut selected, Enum::First, "First");
        ui.selectable_value(&mut selected, Enum::Second, "Second");
        ui.selectable_value(&mut selected, Enum::Third, "Third");
    }
);

Implementations

Label shown next to the combo box

Without label.

Set the width of the button and menu

What we show as the currently selected value

Show the combo box, with the given ui code for the menu contents.

Returns InnerResponse { inner: None } if the combo box is closed.

Show a list of items with the given selected index.

let alternatives = ["a", "b", "c", "d"];
let mut selected = 2;
egui::ComboBox::from_label( "Select one!").show_index(
    ui,
    &mut selected,
    alternatives.len(),
    |i| alternatives[i].to_owned()
);

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Constructs wrapped service

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.