gpt4 book ai didi

cocoa - 后台应用程序的关键窗口

转载 作者:行者123 更新时间:2023-12-03 17:30:56 24 4
gpt4 key购买 nike

我正在创建一个后台 cocoa 应用程序。它唯一缺少的是接受文本输入的能力!

我通过在 Info.plist 中设置“应用程序仅在后台”来使应用程序处于后台

但无论我做什么,我都无法将任何窗口设置为 keyWindow。

makeKeyWindow
makeKeyAndOrderFront

两者都不起作用...

我知道应用程序可以做到这一点,任何人都知道如何让后台应用程序拥有一个关键窗口?

最佳答案

尝试使用LSUIElement :

LSUIElement (String - Mac OS X) specifies whether the application runs as an agent application. If this key is set to “1”, Launch Services runs the application as an agent application. Agent applications do not appear in the Dock or in the Force Quit window. Although they typically run as background applications, they can come to the foreground to present a user interface if desired. [..]

如果您将 plist 编辑器切换到原始键,您将看到“Application is back only”是 LSBackgroundOnly,用于不露面的应用程序。

关于cocoa - 后台应用程序的关键窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2672324/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com