I have created a NSStatusBar NSMenu like this:
- (NSMenu *)startUpViewBarMenu {
NSMenu *menu = [[NSMenu alloc] init];
NSMenuItem* info = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
//[info setTarget:self];
[info setView:[self startUpView]];
[menu addItem:info];
// Disable auto enable
[menu setAutoenablesItems:NO];
[menu setDelegate:(id)self];
return menu;
}
I would like to dynamically move the NSView ([self startUpView]
) that points to where the icon is. Similar to how Evernote has done it. As you can see it is central to the icon:
Whereas with my NSStatusBar the NSView falls either to the left or right of the NSStatusBar icon.
So two questions:
How can I move the dropdown NSView?
I have tried changing the frame (-100) but it makes no difference:
NSView *view = [[NSView alloc] initWithFrame:NSMakeRect(-100, 0, 400, 471)];