研究如何将我的wx2.8python应用程序移植到wx3.0.2classic(是时候了)并遇到了这个障碍。显然GetItemHeight不再是类的一部分:
bash\basher\patcher_dialog.py:519: wxPyDeprecationWarning: Accessing deprecated property.
mouseItem = (event.m_y/self.gPatchers.GetItemHeight() +
Traceback (most recent call last):
File "bash\basher\patcher_dialog.py", line 519, in OnMouse
mouseItem = (event.m_y/self.gPatchers.GetItemHeight() +
AttributeError: 'CheckListBox' object has no attribute 'GetItemHeight'
人们使用它们来获取鼠标事件处理程序中悬停的项目(下面的gPatchers是一个wx.CheckListBox
):
那么如何在wxpython3.0.2中实现这一点呢?在
编辑:在wx用户邮件列表中交叉发布:https://groups.google.com/forum/#!topic/wxpython-users/mMYr-51sE4s
您只需使用底层类} 来查找哪个项位于给定的x/y坐标。Item是列表元素的
ListBox
中的^{int
索引。该文档适用于wxPython phoenix,但在wxPython MSW classic 3.0.2下工作原理相同。在嗨,你可以试试下面的技巧
相关问题 更多 >
编程相关推荐