X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/780bb8744b5a9d9492831f0bd338251aa4641c56..ee3510132b8b4160f848bd4f502a6f5315f90dbc:/src/gtk1/listbox.cpp?ds=sidebyside diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index 8e5a52297f..56089bfd2c 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -84,7 +84,7 @@ struct wxlistbox_idle_struct gint m_tag; }; -static gint wxlistbox_idle_callback( gpointer gdata ) +extern "C" gint wxlistbox_idle_callback( gpointer gdata ) { wxlistbox_idle_struct* data = (wxlistbox_idle_struct*) gdata; gdk_threads_enter(); @@ -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,11 +409,15 @@ 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(); - SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_LISTBOX ) ); + SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX ) ); SetForegroundColour( parent->GetForegroundColour() ); SetFont( parent->GetFont() ); @@ -1044,7 +1046,7 @@ wxSize wxListBox::DoGetBestSize() const } // Add room for the scrollbar - lbWidth += wxSystemSettings::GetSystemMetric(wxSYS_VSCROLL_X); + lbWidth += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); // And just a bit more int cx, cy;