Re: getting result of NSAlertPanel
Re: getting result of NSAlertPanel
- Subject: Re: getting result of NSAlertPanel
- From: email@hidden
- Date: Fri, 26 Apr 2002 14:56:18 +0200
On vendredi, avril 26, 2002, at 02:25 , Mamdouh wrote:
Hi...
This a very simple (probably newbie) question. I have a
NSInformationalAlertPanel and i want to get the result of the button
selected by the user, so i can make some kind of action for that
button...
heres a snip:
<<<<<<<<<<<<
if ( [YadaYadaYada:moreYada] )
{
NSRunInformationalAlertPanel(@"Title", @"InformationText", @"OK",
@"Later", @"Cancel",nil);
}
<<<<<<<<<<<<<
I looked inside the TextEdit example and it does something like this:
if (result == NSAlertDefaultReturn) {
[SomeKindofAction];
}
I'm not sure to understand. Why don't you just do this?
int result;
result= NSRunInformationalAlertPanel(@"Title", @"InformationText",
@"OK", @"Later", @"Cancel",nil);
switch(result)
{
case NSAlertDefaultReturn: // OK
break;
case NSAlertAlternateReturn: // Later
break;
case NSAlertOtherReturn: // Cancel
break;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.