I currently use wx.TipWindow and would like to switch to SST
Currently I have the following code in a left down event on a grid cell:
self.tip = wx.TipWindow(self, msg, maxLength = len(msg))
self.tip.Bind(wx.EVT_KEY_DOWN, self.OnTipKeyDown)
Replaced it with the following:
self.sttInst = self.DoGenerateTip(msg, self.rackGrid.table.data[pos])
self.tip = STT.ToolTipWindow(self, self.sttInst)
self.tip.Bind(wx.EVT_KEY_DOWN, self.OnTipKeyDown)
DoGenerateTip is similar code as in OnGenerateTip (see below) in the wxPython demo.
However when I click on a cell the code gets run but no tip is shown.
What am I missing?
Appreciate any tips.
Werner
def DoGenerateTip(self, msg, gdata):
#TODO: clean up, get wine image
SSTstyle = 'Office 2007 Blue'
headerText, headerBmp, drawHLine = "", wx.NullBitmap, False
headerText = msg[0]
if gdata[0]:
headerBmp = getattr(myimages, gdata[0]).GetBitmap()
else:
headerBmp = wx.NullBitmap
bodyImage = wx.NullBitmap
if not hasattr(self, "sstTip"):
self.sstTip = STT.SuperToolTip(msg)
else:
self.sstTip.SetMessage(msg)
self.sstTip.SetBodyImage(bodyImage)
self.sstTip.SetHeader(headerText)
self.sstTip.SetHeaderBitmap(headerBmp)
## self.sstTip.SetTarget(self) # doesn't make a difference
self.sstTip.SetDrawHeaderLine(True)
self.sstTip.SetDropShadow(True)
self.sstTip.SetEndDelay(5)
self.sstTip.ApplyStyle(SSTstyle)
return self.sstTip