From: Robin Dunn Date: Fri, 10 Mar 2006 00:30:28 +0000 (+0000) Subject: Test wx.ListBox.HitTest X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/35c15a4d84b7af2058b28a5d6d1e52e7199c021b Test wx.ListBox.HitTest git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/demo/CheckListBox.py b/wxPython/demo/CheckListBox.py index 4b64f42075..ffd4b180a4 100644 --- a/wxPython/demo/CheckListBox.py +++ b/wxPython/demo/CheckListBox.py @@ -20,6 +20,8 @@ class TestPanel(wx.Panel): lb.SetSelection(0) self.lb = lb + lb.Bind(wx.EVT_RIGHT_DOWN, self.OnDoHitTest) + pos = lb.GetPosition().x + lb.GetSize().width + 25 btn = wx.Button(self, -1, "Test SetString", (pos, 50)) self.Bind(wx.EVT_BUTTON, self.OnTestButton, btn) @@ -40,6 +42,10 @@ class TestPanel(wx.Panel): def OnTestButton(self, evt): self.lb.SetString(4, "FUBAR") + def OnDoHitTest(self, evt): + item = self.lb.HitTest(evt.GetPosition()) + self.log.write("HitTest: %d\n" % item) + #---------------------------------------------------------------------- def runTest(frame, nb, log):