X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/780bb8744b5a9d9492831f0bd338251aa4641c56..88594d02eb59a55ac85d3210a49d02918124617b:/src/gtk/listbox.cpp?ds=sidebyside diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 8e5a52297f..9cf8883c8e 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -393,8 +393,6 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, gtk_widget_show( GTK_WIDGET(m_list) ); - SetBestSize( size ); - if ( style & wxLB_SORT ) { // this will change DoAppend() behaviour @@ -411,6 +409,10 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, DoAppend(choices[i]); } + // call it after appending the strings to the listbox, otherwise it doesn't + // work correctly + SetBestSize( size ); + m_parent->DoAddChild( this ); PostCreation();