Sheets
Sheets implement window modal (as opposed to application modal) dialogs that are attached to the window. Thus, when a dialog pops up asking for attention, it blocks interaction only with that particular window, not the entire application. When a sheet is opened or closed, it appears to slide out of the title bar. Because the sheet is attached to another window, such as a document window, the user never loses track of what dialog belongs with which window. Figure 3-8 shows an example of a sheet.
![]() |
The Application Kit defines a number of convenient functions for
displaying standard alert and message sheets, including
NSBeginAlertSheet,
NSBegin-InformationalAlertSheet, and
NSBeginCriticalAlertSheet. Each function takes the
same parameters; they differ only in the icon displayed on the left
of the sheet. The function prototype for
NSBeginAlertSheet is the following:
void NSBeginAlertSheet(NSString *title,
NSString *defaultButton,
NSString *alternateButton,
NSString *otherButton,
NSWindow *docWindow,
id modalDelegate,
SEL didEndSelector,
SEL didDismissSelector,
void *contextInfo,
NSString *msg, ...)Table 3-2 describes each parameter.
|
Parameter |
Description |
Title |
The title of the sheet, displayed at the top of the sheet in bold-faced font. |
defaultButton |
The title of the ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access
