Question

It seems as if this has been a reported bug already (http://openradar.appspot.com/9722231), but is there a way to get around it? Or is there an alternative to the NSPopover that can be used to create the same kind of interface?

Thanks in advance

Here's some code:

Popover creation

popover = [[NSPopover alloc] init];
popover.contentViewController = popover_controller;
popover.appearance = NSPopoverAppearanceMinimal;
popover.animates = YES;
popover.behavior = NSPopoverBehaviorTransient;
popover.delegate = self;

Displaying the Popover

[popover showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMaxYEdge];

The sender is the NSStatusItem. The popover is displayed just fine, but if you try to click on the NSTextField, you are unable to edit the text or just gain focus in general.

Was it helpful?

Solution

So it turns out that this is a core OS bug and the only way around it was to use a custom NSWindow that looks like an NSPopover. I decided to use MAAttachedWindow.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top