-static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox *listbox )
-{
- if (g_isIdle) wxapp_install_idle_handler();
-
- if (!listbox->m_hasVMT) return;
- if (g_blockEventsOnDrag) return;
-
- wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, listbox->GetId() );
- event.SetEventObject( listbox );
-
- wxArrayInt aSelections;
- int n, count = listbox->GetSelections(aSelections);
- if ( count > 0 )
- {
- n = aSelections[0];
- if ( listbox->HasClientObjectData() )
- event.SetClientObject( listbox->GetClientObject(n) );
- else if ( listbox->HasClientUntypedData() )
- event.SetClientData( listbox->GetClientData(n) );
- event.SetString( listbox->GetString(n) );
- }
- else
- {
- n = -1;
- }
-
- event.m_commandInt = n;