⇤ ← Revision 1 as of 2006-04-23 00:47:54
Size: 1366
Comment: missing edit-log entry for this revision
|
← Revision 2 as of 2008-03-11 10:50:27 ⇥
Size: 1366
Comment: converted to 1.6 markup
|
No differences found! |
Introduction
Will Sadkin was wondering why the wxListCtrl doesn't automatically show a tool tip on wxMSW when the items are partially obscured. The wxTreeCtrl does it and the list control in other apps does it too...
So Will and friends did a bit of research and figured out how to do it. "...it requires a recent version of the comctl32.dll (version 5.80+), such as distributed with IE5, but it works."
The Code
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 style = SendMessage(listCtrl.GetHandle(), commctrl.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0) style = style | LVS_EX_LABELTIP SendMessage(listCtrl.GetHandle(), commctrl.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, style)
Other Options
There is also a LVS_EX_INFOTIP style that can be used with 4.71+ of comctl32.dll, but requires responding to a notification message to set the text to be used for the tool tip. If somebody wants to make a patch to the C++ code for wxListCtrl that implements this I'm sure it will be accepted.