【发布时间】:2014-07-22 12:32:55
【问题描述】:
我希望允许用户在单击用户要选择的第一行和最后一行时按住 Shift 按钮在 Grid 中选择更多行。 我已经对此进行了测试:
def OnRangeSelect(self, event):
if event.Selecting():
top = event.GetTopRow()
bottom = event.GetBottomRow()
while top <= bottom:
print bottom
self.myGrid.SelectRow(top, True)
top += 1
event.Skip()
还有这个:
def OnRangeSelect(self, event):
event.Skip()
但总是会发生同样的事情......
但是有一些棘手的事情发生了:
1) 函数正在调用 -> 好的
2) 尽管进入循环,但它不会选择行(使用 PyDev 调试器进行测试)
3)如果我选择例如第 3 行作为顶行,第 6 行作为底行,wxPython 选择从 0 到 6 的所有行...
我不知道该怎么办...
Python 版本:2.7
wxPython-2.9版
【问题讨论】: