X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/385e8575dd1f9219fb0e3f7fa26ffe4c24d2fdbb..c6182d489c7cf71c9dba511e3f68671f5b17d50d:/src/gtk/combobox.cpp?ds=inline diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 045c6166ba..445a6cddb1 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -282,6 +282,19 @@ void wxComboBox::SetValue(const wxString& value) wxTextEntry::SetValue(value); } +void wxComboBox::SetString(unsigned int n, const wxString& text) +{ + wxChoice::SetString(n, text); + + if ( static_cast(n) == GetSelection() ) + { + // We also need to update the currently shown text, for consistency + // with wxMSW and also because it makes sense as leaving the old string + // in the text but not in the list would be confusing to the user. + SetValue(text); + } +} + // ---------------------------------------------------------------------------- // standard event handling // ----------------------------------------------------------------------------