Re: Displaying an alert box
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!