CustomTreeCtrl and Tool Tips

9 views
Skip to first unread message

Mears

unread,
Dec 16, 2009, 3:09:23 PM12/16/09
to wxPython-users
I noticed what appears to be an issue with the placement of ToolTips
when using CustomTreeCtrl. If you run the demo and select the
"EVT_TREE_ITEM_GETTOOLTIP" checkbox and hover over an item in the
CustomTreeCtrl, you may notice that the tool tip doesn't pop up where
you'd expect it. I would expect the tip of the cursor to be in the
upper left hand corner of the tool tip. Under windows, the tool tip
comes up just below the mouse cursor. Running under Linux, it pops up
down around the "Demo Log Messages" caption.

Lastly, I think it would be nice to be able to add SuperToolTips to
the tool tip event, especially since it's an agw event.

Robin Dunn

unread,
Dec 16, 2009, 3:52:29 PM12/16/09
to wxpytho...@googlegroups.com
On 12/16/09 12:09 PM, Mears wrote:
> I noticed what appears to be an issue with the placement of ToolTips
> when using CustomTreeCtrl. If you run the demo and select the
> "EVT_TREE_ITEM_GETTOOLTIP" checkbox and hover over an item in the
> CustomTreeCtrl, you may notice that the tool tip doesn't pop up where
> you'd expect it. I would expect the tip of the cursor to be in the
> upper left hand corner of the tool tip. Under windows, the tool tip
> comes up just below the mouse cursor. Running under Linux, it pops up
> down around the "Demo Log Messages" caption.

Unfortunately that is the default behavior in GTK for the built-in
tooltip for widgets. They always show up near the bottom edge of the
widget. For larger widgets where you actually want a tip for an item
within the widget rather than the widget as a whole it doesn't work so
well. I guess that the larger native GTK widgets do something different
than use the built-in tooltip behavior. For generic wx widgets we could
use wx.TipWindow instead.

--
Robin Dunn
Software Craftsman
http://wxPython.org

Mears

unread,
Dec 16, 2009, 5:30:56 PM12/16/09
to wxPython-users
Ok, that answers what's going on in Linux. If memory serves, you
can't use tooltips on the native TreeCtrl in Linux (and maybe that's
why). However, I don't think the placement is correct in Windows
either.

Andrea Gavana

unread,
Dec 16, 2009, 5:33:01 PM12/16/09
to wxpytho...@googlegroups.com
Hi,

2009/12/16 Mears:
As per Robin's explanation, it is not that complicated to build your
own tooltip using wx.TipWindow. In any case, you can easily add
SuperToolTips to CustomTreeCtrl (I do it in all my proprietary apps)
by handling the wx.EVT_MOTION/wx.EVT_LEAVE_WINDOW events in
CustomTreeCtrl. Other than that, CustomTreeCtrl and SuperToolTip are
two completely independent widgets and I don't see why they should be
linked directly in AGW as you suggest. It's already so easy to bind
them yourself if you wish to customize CustomTreeCtrl with
SuperToolTips.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
http://thedoomedcity.blogspot.com/
Reply all
Reply to author
Forward
0 new messages