]> git.saurik.com Git - wxWidgets.git/commitdiff
Test wx.ListBox.HitTest
authorRobin Dunn <robin@alldunn.com>
Fri, 10 Mar 2006 00:30:28 +0000 (00:30 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 10 Mar 2006 00:30:28 +0000 (00:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/CheckListBox.py

index 4b64f420759f6578dde14f3aa7869d7bc204e959..ffd4b180a4261af73d8618fe242124f1fbe7b2fc 100644 (file)
@@ -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):