Re: NSAlertPanel.beginAlertSheet
Re: NSAlertPanel.beginAlertSheet
- Subject: Re: NSAlertPanel.beginAlertSheet
- From: Markus Hitter <email@hidden>
- Date: Sun, 15 Jul 2001 13:24:27 +0200
Am Sonntag, 15. Juli 2001 um 02:55 schrieb Frangois Frisch:
Hello,
Anyone have any idea how you know which button the user pressed when the
sheet is dismissed?
Here a snippet from the App I'm currently working on.
To open the sheet:
[...]
NSBeginAlertSheet(@"file detected",
@"re-use it", @"discard it", nil, [button window], self,
@selector(afterSheet:returnCode:contextInfo:),
nil, nil,
@"There is a file.");
[...]
Then, the "selected" method:
- (void)afterSheet:(NSWindow *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo {
if (returnCode == NSAlertAlternateReturn) {
[[NSFileManager defaultManager] removeFileAtPath:intImageName
handler:nil];
} else {
[...]
I imagine it must be some callback method on the sheet9s delegate.
There is
no documentation....
Some notes are in NSPanel.h
Especially for the functions added lately, you find often some notes in
the headers. Just do a Textual search for your Function name in all
header files to find out.
Have fun,
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/