def onMouseOver(self, event, grid):
        """
        Displays a tooltip over any cell in a certain column
        """
        x, y = grid.CalcUnscrolledPosition(event.GetX(), event.GetY())
        coords = grid.XYToCell(x, y)
        col = coords[1]
        row = coords[0]

        # creates tooltip message for cells with long values
        # note: this works with EPD for windows, and modern wxPython, but not with Canopy Python
        msg = grid.GetCellValue(row, col)
        if len(msg) > 15:
            event.GetEventObject().SetToolTipString(msg)
        else:
            event.GetEventObject().SetToolTipString('')
def onMouseOver ( self , event , grid ) : x , y = grid . CalcUnscrolledPosition ( event . GetX ( ) , event . GetY ( ) ) coords = grid . XYToCell ( x , y ) col = coords [ 1 ] row = coords [ 0 ] msg = grid . GetCellValue ( row , col ) if len ( msg ) > 15 : event . GetEventObject ( ) . SetToolTipString ( msg ) else : event . GetEventObject ( ) . SetToolTipString ( '' )
Displays a tooltip over any cell in a certain column