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 |
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.
- 8 events
- event detachableWindowForPopover as NSWindowMBS
- event popoverDidClose(notification as NSNotificationMBS)
- event popoverDidDetach
- event popoverDidShow(notification as NSNotificationMBS)
- event popoverShouldClose as boolean
- event popoverShouldDetach as boolean
- event popoverWillClose(notification as NSNotificationMBS)
- event popoverWillShow(notification as NSNotificationMBS)
- 7 properties
- property Handle as Integer
- property Tag as Variant
- property animates as boolean
- property behavior as Integer
- property contentSize as NSSizeMBS
- property contentViewController as NSViewControllerMBS
- property positioningRect as NSRectMBS
- 6 methods
- method Close
- method Constructor
- method Destructor
- method isShown as boolean
- method performClose
- method showRelativeToRect(positioningRect as NSRectMBS, view as NSViewMBS, edge as Integer)
- 8 shared methods
- shared method available as boolean
- shared method NSPopoverCloseReasonDetachToWindow as string
- shared method NSPopoverCloseReasonKey as string
- shared method NSPopoverCloseReasonStandard as string
- shared method NSPopoverDidCloseNotification as string
- shared method NSPopoverDidShowNotification as string
- shared method NSPopoverWillCloseNotification as string
- shared method NSPopoverWillShowNotification as string
- 7 constants
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:
- /MacCocoa/NSStatusItem/Statusitem with PopOver
- /MacCocoa/NSStatusItem/Statusitem with PopOver using Container
- /MacControls/Popover/Popover detachableWindowForPopover example
- /MacControls/Popover/Popover window
Blog Entries
- News from the MBS Xojo Plugins Version 23.2
- News from the MBS Xojo Plugins Version 22.4
- MBS Xojo Plugins in version 22.4
- MBS Xojo Plugins, version 22.4pr1
- MBS Xojo Plugins, version 20.3pr7
- Lion features for Real Studio
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