Platforms to show: All Mac Windows Linux Cross-Platform

NSPopoverMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The Xojo class for a pop-over.

A popover is a unit of content that is positioned relative to some other content on the screen. An anchor is used to express the relation between these two units of content. Each popover has an appearance that specifies its visual characteristics, as well as a behavior that determines which user interactions will cause the popover to close. A transient popover is closed in response to most user interactions, whereas a semi-transient popovers is closed when the user interacts with the window containing the popover's positioning view. Popovers with application-defined behavior are not usually closed on the developer's behalf. AppKit automatically positions each popover relative to its positioning view and moves the popover whenever its positioning view moves. A positioning rectangle within the positioning view can be specified for additional granularity. Popovers can be detached to become a separate window when they are dragged by implementing the appropriate delegate method.

Please also check the documentation from Apple for the NSPopover class.
Available in Mac OS X v10.7 and later.

Edge constants

Constant Value Description
MaxXEdge 2 right
MaxYEdge 3 top
(Cocoa coordinates have 0 on bottom of screen)
MinXEdge 0 left
MinYEdge 1 bottom
(Cocoa coordinates have 0 on bottom of screen)

Behavior modes

Constant Value Description
NSPopoverBehaviorApplicationDefined 0 Your application assumes responsibility for closing the popover. AppKit will still close the popover in a limited number of circumstances. For instance, AppKit will attempt to close the popover when the window of its positioningView is closed. The exact interactions in which AppKit will close the popover are not guaranteed. You may consider implementing -cancel: to close the popover when the escape key is pressed.
NSPopoverBehaviorSemitransient 2 AppKit will close the popover when the user interacts with user interface elements in the window containing the popover's positioning view. Semi-transient popovers cannot be shown relative to views in other popovers, nor can they be shown relative to views in child windows. The exact interactions that cause semi-transient popovers to close are not specified.
NSPopoverBehaviorTransient 1 AppKit will close the popover when the user interacts with a user interface element outside the popover. Note that interacting with menus or panels that become key only when needed will not cause a transient popover to close. The exact interactions that will cause transient popovers to close are not specified.

This class has no sub classes.

Some examples using this class:

Blog Entries

Release notes

  • Version 22.4
    • Added popoverShouldDetach and popoverDidDetach events to NSPopoverMBS class.
  • Version 20.3
    • Removed appearance property and NSPopoverAppearanceMinimal plus NSPopoverAppearanceHUD constants from NSPopoverMBS class.

The items on this page are in the following plugins: MBS MacControls Plugin.


NSPointMBS   -   NSPopoverTouchBarItemMBS


The biggest plugin in space...