简体   繁体   English

OS X 上的 SWT:如何将徽章添加到停靠栏图标

[英]SWT on OS X: how to add badges to the dock icon

IntelliJ IDEA, a Swing based application, for example, can show a progress indicator on the dock icon when compiling and checkmark when finishes.例如,基于 Swing 的应用程序 IntelliJ IDEA 可以在编译时在停靠图标上显示进度指示器,并在完成时显示复选标记。 How can this be done for the dock icon of an SWT application?如何为 SWT 应用程序的停靠图标完成此操作?

Have a look at the TaskBar and TaskItem classes of SWT.查看 SWT 的TaskBarTaskItem类。

It's basically:基本上是:

display.getSystemTaskBar().getItem(shell).setProgress(66);

where display is the current display and shell is the window associated with the dock icon.其中display是当前显示, shell是与停靠图标关联的 window。

There's also a code snippet for how to access the task bar.还有一个关于如何访问任务栏的代码片段

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM