X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f16e52c1396f7d58b29b2eea22d7715f0f4596b..f16ba4bb7ec67a12ce247d062ec14734c96aac75:/src/gtk/choice.cpp diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index 2427fdc73f..8ccb592059 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -79,6 +79,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, } m_widget = gtk_combo_box_new_text(); + g_object_ref(m_widget); Append(n, choices); @@ -350,7 +351,7 @@ wxSize wxChoice::DoGetBestSize() const // in the combobox if ( m_widget ) { - ret.x = 60; // start with something "sensible" + ret.x = GetCount() > 0 ? 0 : 60; // start with something "sensible" int width; unsigned int count = GetCount(); for ( unsigned int n = 0; n < count; n++ )