1

I have a standard menubar app (with a dropdown menu) and would like to add the ability for my users to drag files on top of my menubar icon (like this).

Do you know how that is accomplished?

I'm assuming my menubar app has to accept drag and drop. But the thing that really confuses me is how the popout view is animated so nicely.

Any pointers would be much appreciated!

RobertJoseph
  • 7,968
  • 12
  • 68
  • 113

1 Answers1

1

It's simple you should make yours button. You need an nsview to make drag and drop and click action for opening menu by delegate class here is sample that could help and this link for nsview class reference.

Now you should set this view to status button:

NSStatusItem *_statusItem;
_statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
[_statusItem setView:_buttonview];
Community
  • 1
  • 1
kiarash_kiani
  • 27
  • 1
  • 10
  • Thanks @kiarashk - I understand the statusitem part. I'm confused about the animation part - look at the video I linked to. – RobertJoseph Mar 27 '14 at 17:24
  • @CaymanEss if you mean the popup opening animation, NSPopover have this animation by default you should open it by this code: `[[self popover] showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMaxYEdge];` and if you want more customization you should build your own popover – kiarash_kiani Mar 28 '14 at 05:25