]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/combobox.cpp
Added custom properties to style definitions and style sheets
[wxWidgets.git] / src / gtk / combobox.cpp
index 045c6166ba478c697e6651a2bee894aafd52d198..445a6cddb130b7354ddfbceabe041f8608b364c9 100644 (file)
@@ -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<int>(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
 // ----------------------------------------------------------------------------