[wxPython] wxToolTip on wxGrid

I want to show a
  ToolTip on a wxGrid Window. (plattform Windows an Linux )

Depending on the Row where the mouse is, i want to show
different ToolTip Strings (multiple lines) .

which Events do i have to implement ?

Something like this maybe, (where self is a grid):

       EVT_MOTION(self.GetGridWindow(), self.OnMouseMotion)

   def OnMouseMotion(self, evt):
       x, y = evt.GetPosition()
       row = self.YToRow(y)
       col = self.XToCol(x)
       self.GetGridWindow().SetToolTipString(
           "Here is the ToolTip for (%d, %d)" % (row, col))
       evt.Skip()

--
Robin Dunn
Software Craftsman

Great. I used this successfully, though I did have to make one tweak. I believe 'self' in the second argument of the event binding refers to the object instance containing the function definition OnMouseMotion, and only the first 'self' is refers to the grid.

Can anybody tell me what I would bind to so that the tooltips appear over column and row *labels* and not just the cells? Binding to GetGridWindow() seems to only work over cells.

Andrew
Software Butcher

Andrew C. Brown wrote:

Can anybody tell me what I would bind to so that the tooltips appear over column and row *labels* and not just the cells? Binding to GetGridWindow() seems to only work over cells.

GetGridRowLabelWindow() and GetGridColLabelWindow()

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!