diff --git a/egui/src/containers/combo_box.rs b/egui/src/containers/combo_box.rs index adab23b3..8ec4d7aa 100644 --- a/egui/src/containers/combo_box.rs +++ b/egui/src/containers/combo_box.rs @@ -27,6 +27,16 @@ pub struct ComboBox { } impl ComboBox { + /// Create new `ComboBox` with id and label + pub fn new(id_source: impl std::hash::Hash, label: impl Into) -> Self { + Self { + id_source: Id::new(id_source), + label: Some(label.into()), + selected_text: Default::default(), + width: None, + } + } + /// Label shown next to the combo box pub fn from_label(label: impl Into) -> Self { let label = label.into();