i use the following code do force a ToolTip ( platform MS Windows).
The Method WarpPointer forces the displaying of the tooltip in Windows
but not under Linux
how can i force a tooltip under Linux (wxGTK) ??
def OnSelectCell(self, evt):
""" a Cell in the grid got the input focus
Purpose
o Build ToolTip Information of Cell
o force showing of the ToolTip with some tricks
"""
row = evt.GetRow(); col = evt.GetCol()
wx.wxToolTip_Enable(0) #force tooltip
DBG(DBG_XXX, "OnSelectCell Row:%d Col:%d", row, col)
#Build ToolTip String
strVar = self.GetRowLabelValue(row) # SNMP-Var
mib = self.dtarget['BMIB']
vardef = mib.tables[self.table]['VARDEFS'][strVar]
strType, iMin, iMax = vardef['TYPE'], vardef['MIN'], vardef['MAX']
try:
if type(iMin) == type(""): iMin = int(iMin)
except:
iMin = 0
try:
if type(iMax) == type(""): iMax = int(iMax)
except:
iMax = 0
strDefault = vardef['DEFAULT']
strT = strVar + "\nType:" + strType
if iMin != 0 or iMax != 0:
strT = strT + "\nRange: %u - %u" % ( iMin, iMax )
strT = strT + "\nDefault:" + str(strDefault)
self.GetGridWindow().SetToolTipString( strT )
wx.wxToolTip_Enable(1) #force tooltip
wxYield() #force tooltip
#Move the Mouse a little -> force tooltip
(x,y) = wxGetMousePosition()
self.dict['frame'].WarpPointer( 30, 50 )
wxYield()
#wxSafeYield()
#import time # this would work in linux
#time.sleep(1) # this would work on linux
(x,y) = self.ScreenToClientXY(x,y)
self.WarpPointer( x, y ) #calls ::SetCursorPos in Win
wxYield()
evt.Skip() # use SKIP ! if not no Selecting is possible !