• 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: Displaying an alert box
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying an alert box


  • Subject: Re: Displaying an alert box
  • From: David McCabe <email@hidden>
  • Date: Sat, 13 Oct 2001 20:02:41 -0700

How about in Objective-C?

On Saturday, October 13, 2001, at 06:32 PM, Simon Wright wrote:

On Saturday, October 13, 2001, at 08:30 PM, David McCabe wrote:

Greetings,

I would like to have my application display an alert panel which comes to the foreground above all other applications. Despite the simplicity of this task, I have found nothing in the documentation about displaying alerts of any kind, except a small bit on sheets. Can any of you help?

Thanks!


Here is what I do for an alert...

private void myAlert (String title, String message) {
NSApplication.beep();
NSAlertPanel alert = new NSAlertPanel();
alert.runAlert(title, message, null, null, null);
}

And here's a confirm...

private boolean myConfirm (String title, String message, String yesText, String noText) {
NSApplication.beep();
NSAlertPanel alert = new NSAlertPanel();
return (alert.runAlert(title, message, yesText, noText, null) == NSAlertPanel.DefaultReturn);
}


HTH

Simon
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


--
David McCabe
http://homepage.mac.com/davidmccabe/
'finger email@hidden' for PGP key.
No PGP sig because it's broken. Will fix soon.
Wrfhf ybirf lbh!


  • Follow-Ups:
    • Re: Displaying an alert box
      • From: Stéphane Sudre <email@hidden>
    • Re: Displaying an alert box
      • From: Finlay Dobbie <email@hidden>
References: 
 >Re: Displaying an alert box (From: Simon Wright <email@hidden>)

  • Prev by Date: Image Capture
  • Next by Date: Instantiating window from nib
  • Previous by thread: Re: Displaying an alert box
  • Next by thread: Re: Displaying an alert box
  • Index(es):
    • Date
    • Thread