'egui combobox vector for selected

I am trying to use a vector instead of the enum specified in the docs but I have no clue how to implement the selected part. My current code is

egui::ComboBox::from_label("Take your pick")
    .selected_text(format!("{}", self.radio[0]))
    .show_ui(ui, |ui| {
        for i in 0..self.radio.len() {
            ui.selectable_value(&mut &self.radio, &self.radio, &self.radio[i]);
        }
    });

can anyone give me an idea. I do not mind using enum but I do not know how many things will be in it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source