From: Vadim Zeitlin Date: Mon, 26 Nov 2001 16:35:04 +0000 (+0000) Subject: fixed listbox initial size determination X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/13960e3c699644b8703ab882c902e90d7645e4e7?ds=sidebyside fixed listbox initial size determination git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12710 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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(); diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index 8e5a52297f..9cf8883c8e 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/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();