开发者

How to create a NSWindow inside a menulet [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this qu开发者_开发技巧estion so that it can be reopened, visit the help center. Closed 11 years ago.

I'm creating a menulet application in Xcode 4, and I'm trying to figure out how to display a window that will appear when the menulet icon is clicked. I would hope for the window to be displayed as the normal NSWindow.

I have looked at the MAAttatchedWindow source code, and that doesn't seem to help me at all. Could someone please explain how to make a menulet drop-down a window when clicked?

I believe I'm supposed to use the setView: function to create a custom view for the NSStatusItem, but can't quite figure out how to code should be layed out. I have this so far:

  -(void)awakeFromNib {
statusItem = [[[NSStatusBar systemStatusBar]
              statusItemWithLength:NSVariableStatusItemLength]retain];
[statusItem setHighlightMode:YES];
[statusItem setTitle:[NSString stringWithFormat:@"%C", 0x24DC]];
[statusItem setEnabled:YES];
[statusItem setView:(NSView *) 

how to I get the MAAttachedWindow to display as an NSView?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜