From 182cad34aa73a65ee29736d8314f8c282d02efad Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 29 Apr 2012 23:22:01 +0000 Subject: [PATCH] Preserve wxComboBox selection when modifying the selected item in wxGTK too. This does the same thing as r70018 did for wxMSW but for wxGTK, i.e. it keeps the combo box item selected when its text is modified. This fixes [Bitmap]ComboBox unit tests under wxGTK. See #13769. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/combobox.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 445a6cddb1..62da3070c9 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -292,6 +292,10 @@ void wxComboBox::SetString(unsigned int n, const wxString& text) // 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); + + // And we need to keep the selection unchanged, modifying the item is + // not supposed to deselect it. + SetSelection(n); } } -- 2.45.2