]> git.saurik.com Git - wxWidgets.git/commitdiff
Disable events upon item deletion (just in case) and update selection cache
authorRobert Roebling <robert@roebling.de>
Fri, 23 May 2008 09:46:19 +0000 (09:46 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 23 May 2008 09:46:19 +0000 (09:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53713 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/listbox.cpp

index 66669dfdc21d8bed9a6f76bfbfaaf9c7f363c6e8..225c06994d2f7f0ed2b4e6fbcd2170cff313d4f8 100644 (file)
@@ -645,9 +645,13 @@ void wxListBox::DoClear()
 {
     wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
 
+    GtkDisableEvents(); // just in case
+
     InvalidateBestSize();
 
     gtk_list_store_clear( m_liststore ); /* well, THAT was easy :) */
+                                
+    GtkEnableEvents();
 }
 
 void wxListBox::DoDeleteOneItem(unsigned int n)
@@ -656,12 +660,16 @@ void wxListBox::DoDeleteOneItem(unsigned int n)
 
     InvalidateBestSize();
 
+    GtkDisableEvents(); // just in case
+
     GtkTreeIter iter;
     wxCHECK_RET( GtkGetIteratorFor(n, &iter), wxT("wrong listbox index") );
 
     // this returns false if iter is invalid (e.g. deleting item at end) but
     // since we don't use iter, we ignore the return value
     gtk_list_store_remove(m_liststore, &iter);
+                                
+    GtkEnableEvents();
 }
 
 // ----------------------------------------------------------------------------