Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSPopoverMBS class.

NSPopoverMBS.detachableWindowForPopover as NSWindowMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No
Detaches the popover creating a window containing the content.

You return a window instance to which the popover should be detached.

You should not remove the popover's content view as part of your implementation of this method.

The popover and the detachable window may be shown at the same time and therefore cannot share a content view (or a content view controller).

If the popover and the detachable window should have the same content, you should define the content with a separate view and use a view controller to instantiate separate copies of the content for the popover and the detachable window.

The popover will animate to appear as though it morphs into the detachable window (unless the popover animates property is set to false. The exact animation used is not guaranteed.

If you do not implement this event or it returns nil, the default behavior is that the popup is not detached.

Some examples using this event:

NSPopoverMBS.popoverDidClose(notification as NSNotificationMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No
Invoked when the popover did close.

Invoked on the delegate when the NSPopoverDidCloseNotification notification is sent.

Some examples using this event:

NSPopoverMBS.popoverDidDetach

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa MBS MacControls Plugin 22.4 ✅ Yes ❌ No ❌ No ❌ No
Indicates that a popover has been released while it's in an implicitly detached state.

This event is not called when the popover's detached window is returned by detachableWindowForPopover.

Some examples using this event:

NSPopoverMBS.popoverDidShow(notification as NSNotificationMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No
Invoked when the popover has been shown.

Invoked on the delegate when the NSPopoverDidShowNotification notification is sent.

Some examples using this event:

NSPopoverMBS.popoverShouldClose as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No
Allows a delegate to override a close request.

Return true if the popover should close, false otherwise.

The popover invokes this method on its delegate whenever it is about to close. This gives you a chance to override the close.

If you do not implement this method the default behavior is that the popover will close.

Some examples using this event:

NSPopoverMBS.popoverShouldDetach as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa MBS MacControls Plugin 22.4 ✅ Yes ❌ No ❌ No ❌ No
Returns a Boolean value that indicates whether a popover should detach from its positioning view and become a separate window.

If you don't implement this event, it returns false by default. If you return true from this event, but you don't implement detachableWindowForPopover or you implement it to return nil, a detachable window is created with the popover’s contentViewController.

An automatically created window has the same appearance as the detached popover. For example, if the popover's contentViewController has a title, it will be bound to and displayed as the title of the detached window. When a popover is released in a detached state, it calls popoverDidDetach event. When a detached popover is closed, calls to popoverShouldClose, popoverWillClose, and popoverDidClose, in addition to the related notifications, specify the reason NSPopoverCloseReasonStandard.

Some examples using this event:

NSPopoverMBS.popoverWillClose(notification as NSNotificationMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No
Invoked when the popover is about to close.

Invoked on the delegate when the NSPopoverWillCloseNotification notification is sent.

Some examples using this event:

NSPopoverMBS.popoverWillShow(notification as NSNotificationMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa MBS MacControls Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No
Invoked when the popover will show.

Invoked on the delegate when the NSPopoverWillShowNotification notification is sent.

Some examples using this event:

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


The biggest plugin in space...