X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e8375af8ff97a3649361b988a40b991a8cdaab09..823fb291ae04c8236e4ef129209f488812d638fb:/src/gtk/combobox.cpp?ds=inline diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 10f20fbd1a..7fb0ce2424 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -946,7 +946,10 @@ void wxComboBox::SetValue( const wxString& value ) wxString tmp; if (!value.IsNull()) tmp = value; + + DisableEvents(); gtk_entry_set_text( entry, wxGTK_CONV( tmp ) ); + EnableEvents(); InvalidateBestSize(); } @@ -1114,12 +1117,13 @@ void wxComboBox::Replace( long from, long to, const wxString& value ) if (value.IsNull()) return; gint pos = (gint)to; -#if wxUSE_UNICODE - wxCharBuffer buffer = wxConvUTF8.cWX2MB( value ); - gtk_editable_insert_text( GTK_EDITABLE(entry), (const char*) buffer, strlen( (const char*) buffer ), &pos ); +#if wxUSE_UNICODE_UTF8 + const char *utf8 = value.utf8_str(); #else - gtk_editable_insert_text( GTK_EDITABLE(entry), value.c_str(), value.length(), &pos ); + wxCharBuffer buffer(value.utf8_str()); + char char *utf8 = buffer; #endif + gtk_editable_insert_text(GTK_EDITABLE(entry), utf8, strlen(utf8), &pos); } void wxComboBox::SetSelection( long from, long to )