Blocking sheet presentation routines, simpler interfaces

This commit is contained in:
nigel 2002-05-25 23:54:39 +00:00
parent 72129b9348
commit d5995f053a

View File

@ -36,28 +36,58 @@
/* particular window, instead of as a separate window (Panel or Dialog) */ /* particular window, instead of as a separate window (Panel or Dialog) */
/************************************************************************/ /************************************************************************/
void ErrorSheet (NSString * message, NSWindow * window)
{
NSLog(message);
NSBeginCriticalAlertSheet(message, nil, nil, nil, window,
nil, nil, nil, NULL, @"");
while ( [window attachedSheet] )
[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow: 1.0]];
}
void ErrorSheet (NSString * message1, NSString * message2, void ErrorSheet (NSString * message1, NSString * message2,
NSString * button, NSWindow * win) NSString * button, NSWindow * window)
{ {
NSBeginCriticalAlertSheet(message1, button, nil, nil, win, NSLog(message1);
nil, NULL, NULL, NULL, message2); NSLog(message2);
NSBeginCriticalAlertSheet(message1, button, nil, nil, window,
nil, nil, nil, NULL, message2);
while ( [window attachedSheet] )
[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow: 1.0]];
} }
void WarningSheet (NSString * message, NSWindow * window)
{
NSLog(message);
NSBeginAlertSheet(message, nil, nil, nil, window,
nil, nil, nil, NULL, @"");
}
void WarningSheet (NSString * message1, NSString * message2, void WarningSheet (NSString * message1, NSString * message2,
NSString * button, NSWindow * win) NSString * button, NSWindow * window)
{ {
NSBeginAlertSheet(message1, button, nil, nil, win, NSLog(message1);
nil, NULL, NULL, NULL, message2); NSLog(message2);
NSBeginAlertSheet(message1, button, nil, nil, window,
nil, nil, nil, NULL, message2);
} }
void InfoSheet (NSString * message1, NSString * message2, void InfoSheet (NSString * message, NSWindow * window)
NSString * button, NSWindow * win)
{ {
NSBeginInformationalAlertSheet(message1, button, nil, nil, win, NSLog(message);
nil, NULL, NULL, NULL, message2); NSBeginInformationalAlertSheet(message, nil, nil, nil, window,
nil, nil, nil, NULL, @"");
}
void InfoSheet (NSString * message1, NSString * message2,
NSString * button, NSWindow * window)
{
NSLog(message1);
NSLog(message2);
NSBeginInformationalAlertSheet(message1, nil, nil, nil, window,
nil, nil, nil, NULL, message2);
} }