diff --git a/docs/changes.txt b/docs/changes.txt index 7269c040ad..cf47256cd3 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -91,6 +91,7 @@ wxGTK: - Support building wxGTK3 under Windows (Kolya Kosenko). - Fix vertical cell alignment in wxDataViewCtrl. +- Fix clearing of wxComboBox with wxCB_READONLY (Chuddah). wxMSW: diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index d507865f53..f08cf2b1f8 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -297,7 +297,12 @@ wxComboBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) void wxComboBox::Clear() { - wxTextEntry::Clear(); + // Do not call wxTextEntry::Clear() here as it's implemented in terms of + // virtual SetValue() and so would call our own overridden version of this + // method, which wouldn't do the right thing in wxCB_READONLY case. + // + // Clear the text directly to avoid this. + wxTextEntry::SetValue(wxString()); wxItemContainer::Clear(); }