Chapter 22. Sheets

A sheet is simply an instance of NSWindow that is attached to another window. The sheet comes down over the window, and the window stops getting events until the sheet is dismissed. Typically, you will compose a sheet as an off-screen window in your nib file.

NSApplication has several methods that make sheets possible:

// Start a sheet
- (void)beginSheet:(NSWindow *)sheet
    modalForWindow:(NSWindow *)docWindow
       contextInfo:(void *)contextInfo;

// End the sheet
- (void)endSheet:(NSWindow *)sheet returnCode:(int)returnCode;

Besides the sheet window and the window to which it is attached, you supply a modal delegate, a selector, and a pointer when you start the sheet. ...

Get COCOA PROGRAMMING FOR MAC OS X SECOND EDITION now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.