Cocoa:在运行时添加另一个停靠图标

发布于 2024-12-04 12:32:13 字数 434 浏览 0 评论 0原文

是否可以在运行时向扩展坞添加另一个图标而不使用 [NSWorkspace launchApplication:]

如何?


在你说“不”之前:我愿意使用像 fork() 等东西。

我实际上尝试了一些 fork() 但我收到错误:

The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.

Is it possible to add another icon to the dock at runtime without using [NSWorkspace launchApplication:]?

How?


Before you say 'no': I am willing to use stuff like fork() etc.

I actually tried a bit with fork() but I get the error:

The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.

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

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

发布评论

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

评论(2

信仰 2024-12-11 12:32:13

启动另一个应用程序,例如 [NSWorkspace launchApplication:]

Launch another application, via e.g. [NSWorkspace launchApplication:].

惜醉颜 2024-12-11 12:32:13

如果你想在 Dock 上添加额外的图标,Yuji 的答案是最简单的解决方案。
如果您想更改应用程序的现有图标,您可以创建一个 Dock 磁贴插件。
这些插件是随 Snow Leopard 引入的,即使您的应用程序未运行,它们也允许您显示小信息。 (就像 iCal 的图标一样,它始终显示当前日期)。

Apple 的 Dock 磁贴插件文档: http://developer.apple.com/library/mac/#documentation/Carbon/Conceptual/customizing_docktile/CreatingaDockTilePlug-in/CreatingaDockTilePlug-in.html#//apple_ref/doc/uid/TP30000986-CH4 -SW1

If you want to add an additional icon to the Dock, Yuji's answer is the easiest solution.
If you want to change the existing icon of your app, you can create a Dock tile Plug-In.
Those Plug-Ins were introduced with Snow Leopard and they allow you to display small informations even when your app is not running. (Like iCal's icon, which always shows the current date).

Apple's Dock tile Plug-In docs: http://developer.apple.com/library/mac/#documentation/Carbon/Conceptual/customizing_docktile/CreatingaDockTilePlug-in/CreatingaDockTilePlug-in.html#//apple_ref/doc/uid/TP30000986-CH4-SW1

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