Cocoa状态栏(UIElement)应用程序设置窗口

发布于 2024-10-07 10:30:22 字数 113 浏览 0 评论 0原文

我一切正常,但是当我单击设置时,设置窗口(在 nswindowcontroller 中)会在我的 Mac 上运行的其他应用程序的背面打开。我希望它位于前面,以便用户单击它时可以看到它。

谢谢大家!

I got it all working, but when i click on the settings, the settings window (in nswindowcontroller) opens up on the back of other apps running on my mac. I want it in the front so user can see it when he clicks it.

Thank you all!

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

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

发布评论

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

评论(1

吾性傲以野 2024-10-14 10:30:22

看来我终于开始工作了! :)

[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];

当用户单击设置菜单项时,我执行此代码:) 我编写此代码是为了以防万一有人会寻找类似的东西。

seems like i got it working finally! :)

[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];

when the user clicks the settings menu item, i execute this code :) am writing this just in case if someone will look for a similar thing.

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