"Robin Dunn" <robin@alldunn.com> wrote, in part:
> Since there appears to be no EVT_GRID_LEFT_DOWN I am
> trying to use EVT_LEFT_DOWN, expecting to be able to
> determine somehow the row number from the position within
> the wxGrid window of the click.Are you binding the EVT_LEFT_DOWN directly to the grid or to
grid.GetGridWindow()? The wxGrid is actually composed of several
windows so if you want to catch mouse events for any of them you
need to hook the handler to the compent window.
Thanks, Robin.
This is what I have now, using what I understood you to mean:
class URLsTableGrid ( wxGrid ):
"""Control that displays information about URLs"""
def __init__ ( self, parent ):
wxGrid.__init__ ( self, parent, -1 )
self.table = URLsTable ( )
self.SetTable ( self.table, true )
self.SetRowLabelSize ( 0 )
self.SetMargins ( 0,0 )
self.SetRowLabelAlignment ( wxVERTICAL, wxRIGHT )
self.EnableEditing ( false )
self.previouslySelectedRow = None
EVT_LEFT_DOWN ( self.GetGridWindow ( ), self.OnLeftDown )
EVT_GRID_CELL_RIGHT_CLICK ( self, self.OnCellRightClick )
EVT_GRID_LABEL_LEFT_CLICK ( self, self.OnLabelLeftClick )
EVT_GRID_CELL_LEFT_CLICK ( self, self.OnCellLeftClick )
EVT_GRID_CELL_LEFT_DCLICK ( self, self.OnDClickCell )
EVT_GRID_SELECT_CELL ( self, self.OnSelectCell )
Python now complains that my derived class has no attribute by the name
of GetGridWindow.
Would appreciate if you could suggest something more.
Thanks.
Bill