Is there any way to get an NSPopover to appear when a user clicks on the NSStatusitem in the status bar?
so far in my header i have this:
IBOutlet NSStatusItem *statusitem;
and this :
@property (assign) IBOutlet NSPopover *pop;
Under the method, i have this:
[[NSImage imageNamed:@"mic.png"]setSize:NSMakeSize(20,20)];
statusitem = [[NSStatusBar systemStatusBar]statusItemWithLength:NSVariableStatusItemLength];
[statusitem setHighlightMode:YES];
[statusitem setImage:[NSImage imageNamed:@"mic.png"]];
[statusitem setMenu:menu];
[statusitem setAction:@selector(pop:)]
and
- (void)pop:(id)sender{
[[self pop]showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMaxXEdge];
}
Is there anyway to get this to work?