NSDrawerDelegate Protocol Reference
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.6 and later. |
| Companion guide | |
| Declared in | NSDrawer.h |
Overview
The NSDrawerDelegate protocol defines the messages sent to delegates of NSDrawer. All of the methods of this protocol are optional.
Tasks
Opening and Closing Drawers
-
– drawerShouldOpen: -
– drawerWillOpen: -
– drawerDidOpen: -
– drawerShouldClose: -
– drawerWillClose: -
– drawerDidClose:
Managing Drawer Size
Instance Methods
drawerDidClose:
Notifies the delegate that the drawer has closed.
Parameters
- notification
An
NSDrawerDidCloseNotificationnotification sent by the default notification center immediately after the drawer has closed.
Availability
- Available in OS X v10.0 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSDrawer.hdrawerDidOpen:
Notifies the delegate that the drawer has opened.
Parameters
- notification
An
NSDrawerDidOpenNotificationnotification, sent by the default notification center immediately after the drawer has opened.
Availability
- Available in OS X v10.0 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSDrawer.hdrawerShouldClose:
Asks the delegate if the specified drawer should close.
Parameters
- sender
The drawer being closed.
Return Value
YES to allow the drawer to close; NO to prevent it from closing.
Discussion
This method is invoked on user-initiated attempts to close a drawer by dragging it or when the close: method is called.
Availability
- Available in OS X v10.0 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSDrawer.hdrawerShouldOpen:
Asks the delegate if the specified drawer should open.
Parameters
- sender
The drawer requesting permission to open.
Return Value
YES if the drawer should open; NO to prevent the drawer from opening.
Discussion
This method is invoked on user-initiated attempts to open a drawer by dragging it or when the open: method is called.
Availability
- Available in OS X v10.0 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSDrawer.hdrawerWillClose:
Notifies the delegate the the drawer will close.
Parameters
- notification
An
NSDrawerWillCloseNotificationnotification sent by the default notification center immediately before the drawer is closed.
Availability
- Available in OS X v10.0 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSDrawer.hdrawerWillOpen:
Notifies the delegate that the drawer will open.
Parameters
- notification
An
NSDrawerWillOpenNotificationnotification, sent by the default notification center immediately before the drawer is opened.
Availability
- Available in OS X v10.0 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSDrawer.hdrawerWillResizeContents:toSize:
Invoked when the user resizes the drawer or parent.
Parameters
- sender
The drawer being resized.
- contentSize
The proposed new size of the drawer.
Return Value
The size that the drawer should be resized to. To resize to a different size, simply return the desired size from this method; to avoid resizing, return the current size.
Discussion
The receiver’s minimum and maximum size constraints have already been applied when this method is invoked. While the user is resizing an NSDrawer or its parent, the delegate is sent a series of windowWillResize messages as the NSDrawer or parent window is dragged.
Availability
- Available in OS X v10.0 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSDrawer.h© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-03-31)