Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351633 - Possibility to set image on ToolTip
Summary: Possibility to set image on ToolTip
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-09 11:16 EDT by ben CLA
Modified: 2019-11-14 03:43 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ben CLA 2011-07-09 11:16:09 EDT
Build Identifier: 

It would be a nice feature to allow settings a customized icon for tool tips. On windows, this seems to be easy. The class OS only needs a new constant:

public static final int NIIF_USER = 0x00000004;

and in ToolTip.setVisible there must be a check if an icon was set and if true the following code should be enough (worked for me):

iconData.dwInfoFlags = OS.NIIF_USER;
iconData.hIcon = image.handle;

I didn't take a look how to implement this feature on GTK or Mac. The implementation for GTK however seems to be self implemented. libnotify would be a nicer solution.

Reproducible: Always
Comment 1 Felipe Heidrich CLA 2011-07-11 10:34:54 EDT
Did you check if it is possible on Windows when Tooltip is not using NOTIFYICONDATA ? (the first part of setVisible) ?
For NOTIFYICONDATA, did you try using different images types ?
Comment 2 ben CLA 2011-07-13 09:12:26 EDT
If taken a look at the first part, but I must admit, I'm not very familiar with the Win-API. The documentation states following:

"When wParam contains an HICON, a copy of the icon is created by the tooltip window."

But I don't know what that means for the call to OS.SendMessage(hwndToolTip, OS.TTM_SETTITLE, icon, pszTitle).

By the way, instead of NOTIFYICONDATA.hIcon NOTIFYICONDATA.hBalloonIcon can be used with Vista and later.

I only tried a gif with a resolution of 16x16. I'll try different types and resolutions.
Comment 3 ben CLA 2011-07-29 12:58:05 EDT
I did some further tests and tried all supported formats (bmp, gif, tiff, ico, png, jpg) at 100x100 and 22x22 pixels. Windows seems to scale the images automatically to make them fit into the tooltip. However, for ico and tiff I didn't try all possible combinations these formats allow.
Comment 4 Lars Vogel CLA 2019-11-14 03:43:12 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.