|
Size: 543
Comment:
|
← Revision 5 as of 2008-03-11 10:50:22 ⇥
Size: 543
Comment: converted to 1.6 markup
|
| No differences found! | |
HitTest and HitTestXY for wxListBox
This experimental code shows how to implement a working HitTestXY method for wxListBox
1 class MyListBox(wx.ListBox):
2 def HitTestXY(self,x,y):
3 xs,ys = self.GetClientSize()
4 if (y<0) or (x<0) or (x>=xs) or (y>=ys):
5 return -1
6 index = self.GetScrollPos(wx.VERTICAL) + y/self.GetCharHeight()
7 if index >= self.GetCount():
8 return -1
9 return index
10 def HitTest(self,pos):
11 return self.HitTestXY(*pos)
