Robin Dunn wrote (in 2004):
jf gosset wrote: > Hi, > > The association of a tooltip and a wxStaticText is accepted: > myStaticText.SetToolTipString ("blah blah") > But the tooltip never appaers. > > Is it a limitation or a bug ? A limitation. The wxStaticText isn't able to get all the mouse events. > > It's rather possible to use a workaround: place the StaticText in a panel > and attribute the tooltip to the panel. Yes that is one way. Another is to use the generic static text control located in wx.lib.stattext.
I ran into the same problem with wx.StaticText: it seems to block the working of tooltips on its parent panel. I have a bunch of wx.StaticText controls in sizers on a panel. There is nothing in the containment hierarchy (only sizers) in between the StaticTexts and their parent panel. I set a tooltip for the parent panel, and the tooltip pops up appropriately when the mouse is anywhere over the parent panel except if the mouse is over any of the StaticText controls.
So I searched and found the above message/response, and tried switching all of these controls to GenStaticText from wx.lib.stattext. Unfortunately the results appear exactly the same on my system: wxPython
2.8.4.0 (msw-unicode), Python 2.5.1. The parent panel’s tooltip still works only when the mouse pointer is not over any of the GenStaticText controls.
As for the other solution above, placing the static text controls on a panel and setting the tooltip on that panel, that’s exactly what I’m doing and that’s not working either.
What else do I need to do to make a tooltip work for an entire panel regardless of which of the panel’s children the mouse may be above?
Thanks!
Eric