Class

NSPopover

A means to display additional content related to existing content on the screen.

Declaration

@interface NSPopover : NSResponder

Overview

The popover is positioned relative to the existing content and an anchor is used to express the relation between these two units of content. A 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 popover 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.

The system 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.

Topics

Accessing a Popover’s Content View Controller

contentViewController

The view controller that manages the content of the popover.

Managing a Popover's Position and Size

behavior

Specifies the behavior of the popover.

- showRelativeToRect:ofView:preferredEdge:

Shows the popover anchored to the specified view.

positioningRect

The rectangle within the positioning view relative to which the popover should be positioned.

Managing a Popover's Appearance

appearance

The appearance of the popover.

effectiveAppearance

The appearance that will be used when the popover is displayed onscreen.

animates

Specifies if the popover is to be animated.

contentSize

The content size of the popover.

shown

The display state of the popover.

detached

A Boolean value that indicates whether the window created by a popover's detachment is automatically created.

Closing a Popover

- performClose:

Attempts to close the popover.

- close

Forces the popover to close without consulting its delegate.

Getting and Setting the Delegate

delegate

The delegate of the popover.

Constants

NSPopoverBehavior

The appearance and disappearance behavior of a popover.

NSPopoverCloseReasonKey

The userInfo key containing the reason for the NSPopoverWillCloseNotification.

NSPopoverCloseReasonValue

Values that specify the reason for the NSPopoverWillCloseNotification notification.

NSPopoverAppearance

The set of predefined appearances for a popover.

Deprecated

Notifications

NSPopoverWillShowNotification

Sent before the popover is shown.

NSPopoverDidShowNotification

Sent after the popover has finished animating onscreen.

NSPopoverWillCloseNotification

Sent before the popover is closed.

NSPopoverDidCloseNotification

Sent after the popover has finished animating offscreen.

See Also

Popovers

NSPopoverDelegate

A set of optional methods that a popover delegate can implement to provide additional or custom functionality.