Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSPopoverMBS class.

NSPopoverMBS.animates as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Should the popover be animated when it shows, closes, or appears to transition to a detachable window.

This property also controls whether the popover animates when the content view or content size changes. AppKit does not guarantee which behaviors will be animated or that this property will be respected; it is regarded as a hint. The default value is true.
(Read and Write computed property)

NSPopoverMBS.behavior as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The behavior of the popover.

The default behavior is NSPopoverBehaviorApplicationDefined. See the declaration of NSPopoverBehavior* constants for more information about popover behaviors.
(Read and Write computed property)

Some examples using this property:

NSPopoverMBS.Close

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Forces the popover to close without calling events.

Any popovers nested within the popovers will also receive a close message. When a window is closed in response to the close message being sent, all of its popovers will be closed. The popover will animate out when closed (unless the animates property is set to false).

NSPopoverMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new popover.

NSPopoverMBS.contentSize as NSSizeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The content size of the popover.

The popover's content size is set to match the size of the content view when the content view controller is set. Changes to the content size of the popover will animate while the popover is shown (provided animates is true).
(Read and Write computed property)

NSPopoverMBS.contentViewController as NSViewControllerMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The view controller that manages the content of the popover.

Please use with NSViewControllerMBS class.
The default value is nil. You must set the content view controller of the popover to a non-nil value before the popover is shown. Changes to the popover's content view controller while the popover is shown will animate (provided animates is true).
(Read and Write computed property)

NSPopoverMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The destructor.

NSPopoverMBS.isShown as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether popover is visible.

True if the popover is being shown, false otherwise. The popover is considered to be shown from the point when showRelativeToRect is invoked until the popover is closed in response to an invocation of either close or performClose.

NSPopoverMBS.performClose

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Attempts to close the popover.

The popover will not be closed if popoverShouldClose event returns false. The operation will fail if it is displaying a nested popover, or if it has a child window. A window will attempt to close its popovers when it receives a performClose message. The popover will animate out when closed (unless the animates property is set to false).

NSPopoverMBS.positioningRect as NSRectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The positioning rectangle.

Popovers are positioned relative to a positioning view and are automatically moved when the location or size of the positioning view changes. Sometimes it is desirable to position popovers relative to a rectangle within the positioning view. In this case, you must update the positioningRect binding whenever this rectangle changes, or use the positioningRect binding so AppKit can re-position the popover when appropriate.
(Read and Write computed property)

NSPopoverMBS.showRelativeToRect(positioningRect as NSRectMBS, view as NSViewMBS, edge as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Shows the popover positioned relative to positioningRect of positioningView (see the description of positioningRect).

The common case is to pass positioningView.bounds for positioningRect, in which case the popover will be placed adjacent to the positioningView and there is no need to update positioningRect (AppKit will detect the the bounds of the positioning view was specified and automatically update the positioningView). preferredEdge is a hint to AppKit about the desired placement of the anchor of the popover towards the positioningRect, and is with respect to the isFlipped state of the positioningView. Also, if positioningRect is an empty rect, the view.bounds will automatically be used. The current (but not guaranteed) behavior is that AppKit will place the anchor towards the preferredEdge of the positioningRect unless such a placement would cause the popover not to fit on the screen of positioningView. If the anchor cannot be placed towards the preferredEdge, AppKit will (in the current implementation) attempt to place the anchor on the opposite side of the positioningRect. If that cannot be done, AppKit will attempt to place the anchor on a remaining sides of the popover, and failing that will center the popover on the screen, causing it to (at least temporarily) lose its anchor. The popover will animate onscreen and eventually animate offscreen when it is closed (unless the property animates is set to false). This method will throw a NSInvalidArgumentException if view is nil or if view is not in a window, or if the popover's behavior is NSPopoverBehaviorSemitransient and the popover's positioningView is in a popover or child window. It will throw a NSInternalInconsistencyException if the popover's content view controller (or the view controller's view) is nil. If the popover is already being shown, this method will update to be associated with the new view and positioningRect passed. If the positioning view is not visible, this method does nothing.

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


The biggest plugin in space...