I have a list control in a splitter panel, and often the contents of the list
can be partially obscured by the sash. However, unlike a tree control,
the list control doesn't seem to have the nifty ability to put the full text
of the item into a tooltip-like box over the right spot in the control
when the mouse hovers over an item so obscured. (Either that or I don't know
how to enable this feature.)
I tried to dynamically set the tooltip for the control as a possible
workaround, but I can't get tooltips to work at all in the list control
under windows, and I notethat in the wxPython demo, there's a line which
says:
# Why doesn't this show up on MSW???
self.list.SetToolTip(wxToolTip("This is a ToolTip!"))
Has this ever been answered?
Is there any way to get the behavior I want? (ie. that of the tree control?)
I tried to dynamically set the tooltip for the control as a possible
workaround, but I can't get tooltips to work at all in the list control
under windows, and I notethat in the wxPython demo, there's a line which
says:
# Why doesn't this show up on MSW???
self.list.SetToolTip(wxToolTip("This is a ToolTip!"))
Has this ever been answered?
Not that I know of.
Is there any way to get the behavior I want? (ie. that of the tree
control?)
There should be a way since I've seen the native list control do that in
other apps before. Unfortunately I don't know how to do it and a quick
search through MSDN didn't turn up anything either.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
> I have a list control in a splitter panel, and often the contents of the
> list can be partially obscured by the sash. However, unlike a tree
> control, the list control doesn't seem to have the nifty ability to put
> the full text of the item into a tooltip-like box over the right spot in
> the control when the mouse hovers over an item so obscured. (Either that
> or I don't know how to enable this feature.)
> [...]
> Is there any way to get the behavior I want? (ie. that of the tree
> control?)
There should be a way since I've seen the native list control do that in
other apps before. Unfortunately I don't know how to do it and a quick
search through MSDN didn't turn up anything either.
I got a reply on the wxUsers mailing list from Vadim Zeitlin on how to
do this; it requires a recent version of the comctl32.dll (version 5.80+),
such as distributed with IE5, but it works. My colleague did a web search
for an example of how to enable this feature, and converted it to python.
It's not platform-independent, but it works.
Here's a snippet showing how to do it:
# Turn on labeltips in list control
from win32api import SendMessage
import commctrl # from win32 extensions for constants
# All of the extended label styles are missing from the
# current version (1.1) of commctrl.py, but this is the value
# needed:
LVS_EX_LABELTIP = 16384
There's actually a bunch of other interesting extended style options for
MS list controls in the latest dll, and I've written to Mark Hammond to ask
him to update commctrl.py to offer builtin support for them. The latest
version of commctrl.h (from which commctrl.py is auto-generated) is located
in the platform SDK, and the following link in the MSDN gives a list of
extended options (but sadly not their constant values), all of which can
presumably be activated using a mechanism similar to that above.