X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/982d1607826ec0e590146ff40b1dd7068296f004..3f7f284d555df50912037296c5d74a2911975bce:/wxPython/demo/CheckListBox.py?ds=sidebyside 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):