== Introduction == You can set the tooltip for a wxGrid window as a whole using the SetToolTip method, but how do you set different tooltips for individual cells of the grid? Here's how: Have a mouse event check every mouse move to see if you've moved between cells, and change the tooltip when you have. == The Code == Here's a function to do the hard work. Pass the grid along with a callback which takes row and column parameters and returns a tooltip string for that cell. InstallGridHint will do the rest. {{{ #!python def InstallGridHint(grid, rowcolhintcallback): prev_rowcol = [None,None] def OnMouseMotion(evt): # evt.GetRow() and evt.GetCol() would be nice to have here, # but as this is a mouse event, not a grid event, they are not # available and we need to compute them by hand. x, y = grid.CalcUnscrolledPosition(evt.GetPosition()) row = grid.YToRow(y) col = grid.XToCol(x) if (row,col) != prev_rowcol and row >= 0 and col >= 0: prev_rowcol[:] = [row,col] hinttext = rowcolhintcallback(row, col) if hinttext is None: hinttext = '' grid.GetGridWindow().SetToolTipString(hinttext) evt.Skip() wx.EVT_MOTION(grid.GetGridWindow(), OnMouseMotion) }}}