简体   繁体   English

如何创建类似于Dropbox的菜单下拉菜单的NSMenuItem?

[英]How do you create NSMenuItem similar to Dropbox's menu dropdown?

Dropbox has a wonderful new dropdown view for their menubar app. 对于他们的菜单栏应用程序,Dropbox具有一个很棒的新下拉列表视图。 I have failed to find similiar cocoa examples to duplicate this type of view. 我没有找到类似的可可粉例子来复制这种观点。 NSMenuItem seems to be for basic lists. NSMenuItem似乎用于基本列表。 Any pointers in the right direction? 任何指向正确方向的指针?

在此处输入图片说明

It's not a NSMenuItem . 不是NSMenuItem It is a NSStatusItem that resides in the systemwide NSStatusBar . 它是一个NSStatusItem ,位于系统范围的NSStatusBar The distinction is important, because NSStatusItem s can call just about any method on any given object of your application when they're clicked. 区别很重要,因为NSStatusItem时,它们几乎可以在应用程序的任何给定对象上调用任何方法。

I suspect that their NSStatusItem triggers an action that displays a borderless window. 我怀疑他们的NSStatusItem触发了显示无边界窗口的动作。

You can find more information about status items in the Status Bar Programming Topics document. 您可以在“ 状态栏编程主题”文档中找到有关状态项的更多信息。

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

相关问题 如何为具有嵌入式NSProgressIndicator的菜单项创建NSMenuItem视图? - How to create the NSMenuItem view for a menu item with an embedded NSProgressIndicator? 如何创建自定义NSMenuItem - How to create a custom NSMenuItem 您如何指定在NSMenuItem(最小化的窗口指示器)中显示菱形? - How do you specify to display a diamond in a NSMenuItem (minimized window indicator)? 你如何创建一个类似于iphone删除动画的摆动动画 - How do you create a wiggle animation similar to iphone deletion animation Cocoa - 如何使用NSMenuItem的动作传递参数? - Cocoa - How to pass a parameter with NSMenuItem's action? 如何创建iPhone工具栏-下拉/展开菜单 - How to create iphone toolbar - dropdown/expanded menu 如何将 NSMenuItem(启用)的状态绑定到 NSNumber 的特定值? - How do I bind a state of a NSMenuItem (enabled) to a specific value of an NSNumber? 如何隐藏NSMenuItem? - How to hide a NSMenuItem? 如何在UITableView中创建缩进级别(类似于评论回复),在该系统中您可以看到表格视图的背景? - How do I create levels of indentation in my UITableView - similar to a comment reply - system where you can see the background of the table view? 如何以编程方式扩展NSMenuItem? - How to expand an NSMenuItem programmatically?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM