From: Robert Roebling Date: Fri, 23 May 2008 09:46:19 +0000 (+0000) Subject: Disable events upon item deletion (just in case) and update selection cache X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2154130cd11ff567041bf6b74f6fead9dcd8983b Disable events upon item deletion (just in case) and update selection cache git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53713 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 66669dfdc2..225c06994d 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -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(); } // ----------------------------------------------------------------------------