开发者

Stopping a popover window becoming the key window

开发者 https://www.devze.com 2023-03-07 08:40 出处:网络
I am trying to write a Mac application which runs in the menubar, which when clicked, displays an iOS-like popover. Similar to Flexibit\'s Fantastical, or The Iconfactory\'s Take Five.

I am trying to write a Mac application which runs in the menubar, which when clicked, displays an iOS-like popover. Similar to Flexibit's Fantastical, or The Iconfactory's Take Five.

I am using INPopoverContr开发者_如何学Gooller which seems to work great. My problem is that when the user clicks on anything in the popover view, the popover becomes the key window. Is there a way to stop this from happening?


In INPopoverWindow:

- (BOOL)canBecomeKeyWindow
{
    return YES;
}

means that the popover can become a key window. You can either change it to return NO, or subclass INPopoverWindow and override that method to return NO.

0

精彩评论

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