X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4fcfa27cb34a2c1f81090c8a928f8248cc728cd2..5f8ba10e863cf2df9ac0a10033a7d5d866002337:/src/gtk/listbox.cpp?ds=sidebyside diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 3865a4f20c..b522fd7a88 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -237,11 +237,16 @@ gtk_listbox_button_press_callback( GtkWidget *widget, (((listbox->GetWindowStyleFlag() & wxLB_MULTIPLE) != 0) || ((listbox->GetWindowStyleFlag() & wxLB_EXTENDED) != 0)) ) { - if (listbox->IsSelected(sel)) - { - gtk_list_unselect_item( GTK_LIST(listbox->m_list), sel ); - return true; - } + listbox->m_blockEvent = TRUE; + + int i; + for (i = 0; i < (int)listbox->GetCount(); i++) + if (i != sel) + gtk_list_unselect_item( GTK_LIST(listbox->m_list), i ); + + listbox->m_blockEvent = FALSE; + + return false; } /* emit wxEVT_COMMAND_LISTBOX_DOUBLECLICKED later */