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
This commit is contained in:
parent
415ab72e8d
commit
2154130cd1
@ -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();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user