| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in Mac OS X v10.6 and later. |
| Companion guide | |
| Declared in | NSDrawer.h |
| Related sample code |
The NSDrawerDelegate protocol defines the messages sent to delegates of NSDrawer. All of the methods of this protocol are optional.
– drawerShouldOpen:
– drawerWillOpen:
– drawerDidOpen:
– drawerShouldClose:
– drawerWillClose:
– drawerDidClose:
Notifies the delegate that the drawer has closed.
- (void)drawerDidClose:(NSNotification *)notification
An NSDrawerDidCloseNotification notification sent by the default notification center immediately after the drawer has closed.
NSDrawer.hNotifies the delegate that the drawer has opened.
- (void)drawerDidOpen:(NSNotification *)notification
An NSDrawerDidOpenNotification notification, sent by the default notification center immediately after the drawer has opened.
NSDrawer.hAsks the delegate if the specified drawer should close.
- (BOOL)drawerShouldClose:(NSDrawer *)sender
The drawer being closed.
YES to allow the drawer to close; NO to prevent it from closing.
This method is invoked on user-initiated attempts to close a drawer by dragging it or when the close: method is called.
NSDrawer.hAsks the delegate if the specified drawer should open.
- (BOOL)drawerShouldOpen:(NSDrawer *)sender
The drawer requesting permission to open.
YES if the drawer should open; NO to prevent the drawer from opening.
This method is invoked on user-initiated attempts to open a drawer by dragging it or when the open: method is called.
NSDrawer.hNotifies the delegate the the drawer will close.
- (void)drawerWillClose:(NSNotification *)notification
An NSDrawerWillCloseNotification notification sent by the default notification center immediately before the drawer is closed.
NSDrawer.hNotifies the delegate that the drawer will open.
- (void)drawerWillOpen:(NSNotification *)notification
An NSDrawerWillOpenNotification notification, sent by the default notification center immediately before the drawer is opened.
NSDrawer.hInvoked when the user resizes the drawer or parent.
- (NSSize)drawerWillResizeContents:(NSDrawer *)sender toSize:(NSSize)contentSize
The drawer being resized.
The proposed new size of the drawer.
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.
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.
NSDrawer.hLast updated: 2009-03-31