From 198f875b6c9fe091d51660636e771108929f8a2e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 12 Aug 2002 17:54:46 +0000 Subject: [PATCH] More wxListCtrl test code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16467 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/demo/wxListCtrl.py | 1 + wxPython/demo/wxListCtrl_virtual.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/wxPython/demo/wxListCtrl.py b/wxPython/demo/wxListCtrl.py index 799b086228..052e7e2a67 100644 --- a/wxPython/demo/wxListCtrl.py +++ b/wxPython/demo/wxListCtrl.py @@ -221,6 +221,7 @@ class TestListCtrlPanel(wxPanel, wxColumnSorterMixin): # Show how to reselect something we don't want deselected def OnItemDeselected(self, evt): item = evt.GetItem() + print evt.m_itemIndex if evt.m_itemIndex == 11: wxCallAfter(self.list.SetItemState, 11, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED) diff --git a/wxPython/demo/wxListCtrl_virtual.py b/wxPython/demo/wxListCtrl_virtual.py index 3e9a8fa7c1..603ec4ce35 100644 --- a/wxPython/demo/wxListCtrl_virtual.py +++ b/wxPython/demo/wxListCtrl_virtual.py @@ -26,6 +26,7 @@ class TestVirtualList(wxListCtrl): EVT_LIST_ITEM_SELECTED(self, self.GetId(), self.OnItemSelected) EVT_LIST_ITEM_ACTIVATED(self, self.GetId(), self.OnItemActivated) + EVT_LIST_ITEM_DESELECTED(self, self.GetId(), self.OnItemDeselected) def OnItemSelected(self, event): @@ -44,6 +45,10 @@ class TestVirtualList(wxListCtrl): item = self.GetItem(index, col) return item.GetText() + def OnItemDeselected(self, evt): + print evt.m_itemIndex + + #--------------------------------------------------- # These methods are callbacks for implementing the # "virtualness" of the list... -- 2.45.2