Re: NSBeginAlertSheet()
Re: NSBeginAlertSheet()
- Subject: Re: NSBeginAlertSheet()
- From: Finlay Dobbie <email@hidden>
- Date: Sun, 16 Dec 2001 13:48:04 +0000
On Sunday, December 16, 2001, at 01:25 pm, Riccardo Santato wrote:
I was wondering wether some of you has got a little bit of docs for
NSBeginAlertSheet macro,
It's a function.
which is undocumented in my Developer Tools
suite (I don't know if it's the same with the latest release).
The headers are commented.
/*
** Present a sheet alert on the given window. When the modal session
is ended, but before the sheet is dismissed,
** the didEndSelector will be invoked in the modalDelegate. After the
sheet
** is dismissed, the didDismissSelector will be invoked. Typically, you
will want to implement the didEndSelector but you may
** pass NULL for the didDismissSelector.
** The methods should have the following signatures:
** - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo;
** - (void)sheetDidDismiss:(NSWindow *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo;
**
*/
APPKIT_EXTERN void NSBeginAlertSheet(NSString *title, NSString
*defaultButton, NSString *alternateButton, NSString *otherButton,
NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL
didDismissSelector, void *contextInfo, NSString *msg, ...);
APPKIT_EXTERN void NSBeginInformationalAlertSheet(NSString *title,
NSString *defaultButton, NSString *alternateButton, NSString
*otherButton, NSWindow *docWindow, id modalDelegate, SEL didEndSelector,
SEL didDismissSelector, void *contextInfo, NSString *msg, ...);
APPKIT_EXTERN void NSBeginCriticalAlertSheet(NSString *title, NSString
*defaultButton, NSString *alternateButton, NSString *otherButton,
NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL
didDismissSelector, void *contextInfo, NSString *msg, ...);
You might be better off using the NSApplication methods:
/*
** Present a sheet on the given window. When the modal session is
ended,
** the didEndSelector will be invoked in the modalDelegate. The
didEndSelector
** should have the following signature, and will be invoked when the
modal session ends.
** This method should dimiss the sheet using orderOut:
** - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo;
**
*/
- (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow
*)docWindow modalDelegate:(id)modalDelegate
didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;
- (void)endSheet:(NSWindow *)sheet;
- (void)endSheet:(NSWindow *)sheet returnCode:(int)returnCode;
I think these are probably documented in the NSApplication
documentation :-)
Also, there is a simple sheet tutorial over at
http://www.cocoadevcentral.com
Was there something similar even in NeXTStep ?
No. Sheets are a new thing (introduced in OS X DP3 IIRC).
-- Finlay