diff options
Diffstat (limited to 'src/gui/ComboBox.cpp')
-rw-r--r-- | src/gui/ComboBox.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/ComboBox.cpp b/src/gui/ComboBox.cpp index 03e66bd..3aa4439 100644 --- a/src/gui/ComboBox.cpp +++ b/src/gui/ComboBox.cpp @@ -46,7 +46,6 @@ namespace gsr { set_widget_as_selected_in_parent(); else remove_widget_as_selected_in_parent(); - return false; } else { show_dropdown = false; remove_widget_as_selected_in_parent(); @@ -118,6 +117,15 @@ namespace gsr { dirty = true; } + void ComboBox::set_selected_item(const std::string &id) { + for(size_t i = 0; i < items.size(); ++i) { + if(items[i].id == id) { + selected_item = i; + break; + } + } + } + void ComboBox::update_if_dirty() { if(!dirty) return; |