# The following works...
t = wx.ToolTip("")
win.SetToolTip(t)
# ... but I get a little blank tooltip window
# Same with:
t.SetTip("")
win.SetToolTip(t)
I've tried using Enable(), but this appears to do what the docs say and disable tooltips globally. IOW, my other tooltips for other windows are also disabled.
I also just tried:
win.GetToolTip().Destroy()
which rewarded me with a segfault.
So... am I going crazy? How do I say "Make this window no longer have a Tooltip?"
So... am I going crazy? How do I say "Make this window no longer have a
Tooltip?"
I haven't found anything about this issue (but surely Robin will know the
answer) but, what about using wx.TipWindow() instead? In my opinion it is
much more customizable than a simple SetToolTip...
Relax man, this might be just a bug in wxPython, you know… Robin is only human… nice of you to catch it
As a temporary fix until things get cleared… you could go extreme and replace the window with the tooltip with a fresh one without a tooltip, I know is ugly (sizer messing required), but it should work.
Also… you should post your basic specs, at least platform and wxpython version, this might be platform specific.
I'm sorry everyone, I really should have done a better job with my first message. Here's a test script I just ran given Robin's proposed solution. It doesn't go boom like I originally said, but it also has no effect on the ToolTip display, even though o.GetToolTip() does return None.
I tested this on:
(2, 6, 1, 1, 'pre') ('__WXGTK__', 'wxGTK', 'unicode', 'gtk2', 'wx-assertions-off')
Andrea, thanks for suggesting wx.TipWindow(). I had no idea it even existed and I'll check it out straightaway.
Here's my output of the attached script:
pmcnett@sol:~/projects/daboide$ python test.py
(2, 6, 1, 1, 'pre') ('__WXGTK__', 'wxGTK', 'unicode', 'gtk2', 'wx-assertions-off')
<wx._misc.ToolTip; proxy of C++ wxToolTip instance at _20c63f08_p_wxToolTip>
None
I'm sorry everyone, I really should have done a better job with my first message. Here's a test script I just ran given Robin's proposed solution. It doesn't go boom like I originally said, but it also has no effect on the ToolTip display, even though o.GetToolTip() does return None.
I tested this on:
(2, 6, 1, 1, 'pre') ('__WXGTK__', 'wxGTK', 'unicode', 'gtk2', 'wx-assertions-off')
Looks like setting it to None is not explicitly removing the tooltip from the GTK control. I don't see an obvious solution so it will need to be done by somebody that knows GTK better than me. Please enter a bug report about this.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!