从菜单栏应用程序获取文本输入?可可

发布于 2024-12-01 21:12:47 字数 132 浏览 6 评论 0原文

因此,我创建了一个菜单栏应用程序(代理应用程序),我需要找到某种方法来通过菜单栏图标获取文本输入。我听说用文本字段制作弹出模式是不受欢迎的,并且将文本字段放在 NSMenuItem 中对功能不利。当我尝试时,它甚至不起作用。

So I created a menubar app (agent application) and I need to find some way to get textual input via the menubar icon. I heard that making a popup modal with a textfield is frowned upon, and putting a text field in an NSMenuItem is bad for functionality. It doesn't even work, when I try.

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

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

发布评论

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

评论(1

人心善变 2024-12-08 21:12:47

您可以使用新的 NSPopOver< /code>Lion 中的 API。它将创建一个锚定到特定位置的非模式窗口,这似乎正是您正在寻找的。

You could use the new NSPopOver API in Lion. It will create a non-modal window anchored to a particular location, which seems to be exactly what you're looking for.

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