SWT 托盘图标弹出窗口

发布于 2024-09-09 23:10:16 字数 171 浏览 2 评论 0原文

我正在 SWT 中使用 Tray 和 TrayItem,我想知道是否有一种方法可以获取图标在屏幕上的位置。我希望能够将另一个 shell 放置在它的下面,就像它是一个弹出窗口一样。

基本上只是让一匹母马试图找到它的尺寸和位置......

有什么想法吗?

干杯

安迪

I'm playing with a Tray and TrayItem in SWT, and i was wondering if there was a way of getting the location on screen of the icon. I want to be able to position another shell just underneath it as if it were a popup.

Basicaly just having a mare trying to find the dimensions and location of it....

Any ideas?

Cheers

Andy

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

平安喜乐 2024-09-16 23:10:16

你为什么需要这个?

如果显示弹出窗口的触发是鼠标单击,则可以使用侦听器的 Event 对象来获取坐标。

如果不是,我认为这样做不是一个好主意。主要是因为您永远不知道托盘图标是否可见(例如在 Windows 7 中)。如果您使用 Gnome,则可以使用 libNotify,这对于弹出窗口来说是更好的选择。

Why would you need this?

If the trigger for displaying the pop-up is a mouse click, you can use the Event object of the listener to get the co-ordinates.

If not, I don't think its a good idea to do this. Mainly because you never know whether a tray icon will be visible or not (in Windows 7 for example). If you are using Gnome, you can use libNotify, which is a much better choice for pop-ups.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文