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();
gtk_widget_show( GTK_WIDGET(m_list) );
- SetBestSize( size );
-
if ( style & wxLB_SORT )
{
// this will change DoAppend() behaviour
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() );
wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
gtk_list_clear_items( m_list, 0, GetCount() );
+
+ if ( GTK_LIST(m_list)->last_focus_child != NULL )
+ {
+ // This should be NULL, I think.
+ GTK_LIST(m_list)->last_focus_child = NULL;
+ }
if ( HasClientObjectData() )
{
}
// 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;