Re: Supressing NSAlertPanel with time litmit
Re: Supressing NSAlertPanel with time litmit
- Subject: Re: Supressing NSAlertPanel with time litmit
- From: Stephane Sudre <email@hidden>
- Date: Thu, 13 Sep 2007 11:31:08 +0200
On 13 sept. 07, at 6:12, Jajati Sahu wrote:
I have created a NSGetCriticalAlertPanel and run it by
runModalForWindow:
method of NSApp. I have one "OK" button in the alert. Now I want to
close
the alert panel after some delay (suppose 5 seconds) if "OK" button
is not
clicked within that time period. As it is runModal I am not able to
close
the alert before "OK" button clicked.
Is there any way to close the runModal NSAlertPanel giving time
constraint.
I asked a similar question to the NSEvent oracle at WWDC.
You can probably add a NSTimer to the NSModalPanelRunLoopMode mode that
will call:
[NSApp abortModal];
when the delay has expired. stopModal will not correctly work in this
case.
runModalForWindow: will then return NSRunAbortedResponse.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden