// data
//-----------------------------------------------------------------------------
-extern bool g_blockEventsOnDrag;
-extern bool g_blockEventsOnScroll;
-extern wxCursor g_globalCursor;
+extern bool g_blockEventsOnDrag;
+extern bool g_blockEventsOnScroll;
+extern wxCursor g_globalCursor;
+extern wxWindowGTK *g_delayedFocus;
static bool g_hasDoubleClicked = FALSE;
gtk_idle_remove( data->m_tag );
- data->m_listbox->SetFirstItem( data->m_item );
+ // check that the items haven't been deleted from the listbox since we had
+ // installed this callback
+ wxListBox *lbox = data->m_listbox;
+ if ( data->m_item < lbox->GetCount() )
+ {
+ lbox->SetFirstItem( data->m_item );
+ }
delete data;
}
}
+ if (g_delayedFocus == this)
+ {
+ if (GTK_WIDGET_REALIZED(m_widget))
+ {
+ gtk_widget_grab_focus( m_widget );
+ g_delayedFocus = NULL;
+ }
+ }
+
UpdateWindowUI();
}