• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Supressing NSAlertPanel with time litmit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Supressing NSAlertPanel with time litmit (From: "Jajati Sahu" <email@hidden>)

  • Prev by Date: Re: resetting ivars safely
  • Next by Date: Incremental Development?
  • Previous by thread: Re: Supressing NSAlertPanel with time litmit
  • Next by thread: overriding NSObject initWithCoder/encodeWithCoder category?
  • Index(es):
    • Date
    • Thread