Function egui::containers::combo_box_with_label[][src]

pub fn combo_box_with_label(
    ui: &mut Ui,
    label: impl Into<Label>,
    selected: impl Into<String>,
    menu_contents: impl FnOnce(&mut Ui)
) -> Response

A drop-down selection menu with a descriptive label.

See also combo_box.

egui::combo_box_with_label(ui, "Select one!", format!("{:?}", selected), |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");
});