The new grid is working well for me now. I would like to add some
popup-menus that are to be brought up by right-clicking on a cell.
I can capture the right-click with
...
EVT_GRID_CELL_RIGHT_CLICK( self.grid, self.OnCellRClick )
...
And in the handler I can get the row/col of the cell in question with
GetRow() and GetCol() on the event...
def OnCellRClick(self, event):
menu = wxMenu()
selectID = 0
filterID = 0
menu.Append(selectID, "Select")
menu.Append(filterID, "Filter")
EVT_MENU(self, selectID, self.OnSelect)
EVT_MENU(self, filterID, self.OnFilter)
row,col = event.GetRow() )
x,y = ???,???
self.PopupMenu(menu, wxPoint(x,y))
menu.Destroy()
But, how can I turn this row/column into the x,y coodinates suitable
to pass to the PopupMenu method? None of the methods mentioned in the
grid.i class seem to do what I require. The listctrl demo code seems
to capture the x,y with a separate callback for EVT_RIGHT_DOWN(), but
this event does not appear to be generated in a grid.
Any pointers?
Thanks
Tim Docker