NSPopover - Hide when focus lost? (clicked outside of popover)

前端 未结 2 582
你的背包
你的背包 2021-02-13 01:41

I\'m using the doubleClickAction of a NSTableView to display a NSPopover. Something like this:

NSInteger selectedRow = [da         


        
2条回答
  •  无人及你
    2021-02-13 02:05

    You need to change the property behavior of your popover (in code or on interface builder) to:

    popover.behavior = NSPopover.Behavior.transient;
    

    NSPopover.Behavior.transient
    The system will close the popover when the user interacts with a user interface element outside the popover.

    Read more about this in Apple's documentation.

提交回复
热议问题