X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/780bb8744b5a9d9492831f0bd338251aa4641c56..4aaef122cbbd5bbe0e70b824e320458e2329dd13:/src/gtk/listbox.cpp 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();