]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/listbox.cpp
partially fix bug [ wxwindows-Bugs-1145813 ] Centre() Doesn't Work With Dual Monitors...
[wxWidgets.git] / src / gtk / listbox.cpp
index 3865a4f20c61d5ed0cf7370f3838908e0f322c24..b522fd7a88bdc5c8586a4b37bea7683517175482 100644 (file)
@@ -237,11 +237,16 @@ gtk_listbox_button_press_callback( GtkWidget *widget,
          (((listbox->GetWindowStyleFlag() & wxLB_MULTIPLE) != 0) ||
           ((listbox->GetWindowStyleFlag() & wxLB_EXTENDED) != 0)) )
     {
          (((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 */
     }
 
     /* emit wxEVT_COMMAND_LISTBOX_DOUBLECLICKED later */