Re: [Boa Constr] simple way to find table row in grid
Status: Beta
Brought to you by:
riaan
From: paul s. <pa...@me...> - 2005-12-03 00:19:00
|
paul sorenson wrote: > I have some code in a Grid OnMouseMotion handler: > > x, y = event.GetPosition() > table = self.GetTable() > rowobj = table[self.YToRow(y)] > > Now YToRow() apparently yields the visible row index, which is not > necessarily the index into the GridTableBase data (it is if the first > visible row is also the first table row). Apart from searching > for the row I want, is there a simple call to get the table index? The closest thing I have is: for firstVisibleRow in range(0, self.GetNumberRows() - 1): if self.IsVisible(firstVisibleRow, 0): break rowobj = table[self.YToRow(y) + firstVisibleRow] But for some reason that doesn't quite line up with the top and bottom of each row. cheers |