-
I'm trying to add a listener for a combobox when its value changes. It seems |
Beta Was this translation helpful? Give feedback.
Answered by
vbeffa
Dec 1, 2021
Replies: 1 comment 1 reply
-
It looks like you need to add egui::ComboBox::from_label( "Select one!")
.selected_text(format!("{:?}", selected))
.show_ui(ui, |ui| {
if ui.selectable_value(&mut selected, Enum::First, "First").clicked() {
// handle click
};
if ui.selectable_value(&mut selected, Enum::Second, "Second").clicked() {
// handle click
};
if ui.selectable_value(&mut selected, Enum::Third, "Third").clicked() {
// handle click
};
}
); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
vbeffa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like you need to add
if xxx.clicked()
to each value inside the combobox: