Re: Close a alert sheet programatically
Re: Close a alert sheet programatically
- Subject: Re: Close a alert sheet programatically
- From: Denis Defreyne <email@hidden>
- Date: Thu, 6 Jan 2005 12:15:05 +0100
I use this code in my app to open a alert:
NSBeginAlertSheet(@"I have a message for you", @"Close", nil, nil,
myWindowOutlet, self, nil, nil, nil, "blah blah blah);
My question is, how do I close this alert programatically, without
clicking
on the Close button in the alert?
[NSApp endSheet:[self window] returnCode:blah];
will do the trick. Substitute the return code with NSAlertDefaultReturn
for a click on the OK button, NSAlertOtherReturn for Cancel,
NSAlertAlternateReturn for the third button. Also see
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/TypesAndConstants/AppKitTypes.html.
Regards,
amon-re
--
mail: email@hidden
web: http://www.amonre.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden