X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b666df2c102d1e183532adf0c003e63b1a591e2f..da07e0335e1a75d785a1b0f61b26aab7e48aa51e:/src/gtk1/listbox.cpp?ds=inline diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index 0fef727841..32cf66671e 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -72,8 +72,25 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, { wxCommandEvent event( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, listbox->GetId() ); event.SetEventObject( listbox ); - event.SetInt( sel ); + + wxArrayInt aSelections; + int count = listbox->GetSelections(aSelections); + if ( count > 0 ) + { + event.m_commandInt = aSelections[0] ; + event.m_clientData = listbox->GetClientData( event.m_commandInt ); + wxString str(listbox->GetString(event.m_commandInt)); + if (str != "") event.m_commandString = copystring((char *)(const char *)str); + } + else + { + event.m_commandInt = -1 ; + event.m_commandString = copystring("") ; + } + listbox->GetEventHandler()->ProcessEvent( event ); + + if (event.m_commandString) delete[] event.m_commandString ; } return FALSE;