From 13960e3c699644b8703ab882c902e90d7645e4e7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 26 Nov 2001 16:35:04 +0000 Subject: [PATCH] fixed listbox initial size determination git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12710 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/listbox.cpp | 6 ++++-- src/gtk1/listbox.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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(); -- 2.47.2