Location SWT TrayItem

I use SWT + JFace and want to show my application window near the tray icon, for example ToolTip.

Is there any way to get the location of TrayItem?

+1
source share
2 answers

There is no agronizing method for this AFAIK. Ig you really need it, you will likely have to code the base API of the SWT platform according to your GTK example. One way to do this, which builds / works everywhere, is to use reflection to invoke methods based on the return of SWT.getPlatform ().

If the window is launched with the mouse (for example, by hovering), you can use the mouse location as the base location for the hover.

0

, TrayItem extends Item, Widget, :

Tray tray = display.getSystemTray();
TrayItem trayItem = new TrayItem(tray, SWT.NONE);
Rectangle bounds = trayItem.getDisplay().getBounds();
-1

All Articles