Instance Method


Invoked to allow the delegate to specify a display location for the menu.


- (NSRect)confinementRectForMenu:(NSMenu *)menu onScreen:(NSScreen *)screen;



The menu object.


The screen the menu will open on.

Return Value

The rectangle the menu should be displayed within, in screen coordinates.


This method is sent to the delegate when a menu is about to be opened on the specified screen.

If you return NSZeroRect, or if the delegate doesn’t implement this method, the menu will be confined to the bounds appropriate for the given screen. The returned rect may not be honored in all cases, for example, if it would force the menu to be too small.

See Also

Updating Menu Layout

- menu:updateItem:atIndex:shouldCancel:

Invoked to let the delegate update a menu item before it is displayed.