I would like to be warned when user selects the whole row in a wxGrid but I do not see an event that handles this.What is the best way to do it?
A:
You can do this using EVT_GRID_RANGE_SELECT
, and then check that the range is a single row when the handler is called.
For example, in the GridSimple.py wxPython demo, put the line in SimpleGrid.__init__
self.Bind(gridlib.EVT_GRID_RANGE_SELECT, self.OnSelectRange)
And then add this to see which cells were selected.
def OnSelectRange(self, evt):
print "on select range", evt.GetTopLeftCoords(), evt.GetBottomRightCoords()
From this you can determine whether the selection was one that you're interested in.
tom10
2009-08-04 04:06:35