我想让用户在网格中选择更多的行,方法是按住Shift按钮,同时单击用户要选择的第一行和最后一行。 我已经测试过了:
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()
还有这个:
^{pr2}$但总是这样。。。在
但也有一些棘手的事情发生:
1) 函数正在调用->;好的
2) 它不选择行,尽管它进入循环(使用PyDev调试器测试)
3) 如果我选择第3行作为顶行,第6行作为底行,wxPython选择从0到6的所有行。。。在
我不知道该怎么办…
Python版本:2.7
wxPython 2.9版
参考此代码可能有助于:
相关问题 更多 >
编程相关推荐