]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/CheckListBox.py
updated
[wxWidgets.git] / 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):