EndSheet() to end non-modal (i.e. non Error) sheets, fixed leak in ErrorSheet()

This commit is contained in:
nigel 2002-05-30 12:28:38 +00:00
parent c0201dfc68
commit dc41a2b10c
2 changed files with 10 additions and 3 deletions

View File

@ -32,6 +32,7 @@ extern void ErrorSheet (NSString *msg, NSWindow *win),
NSString *button, NSWindow *win),
InfoSheet (NSString *msg, NSWindow *win),
InfoSheet (NSString *msg1, NSString *msg2,
NSString *button, NSWindow *win);
NSString *button, NSWindow *win),
EndSheet (NSWindow * window);
extern int frequencyToTickDelay (float frequency);

View File

@ -42,7 +42,8 @@ void ErrorSheet (NSString * message, NSWindow * window)
NSBeginCriticalAlertSheet(message, nil, nil, nil, window,
nil, nil, nil, NULL, @"");
while ( [window attachedSheet] )
[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow: 1.0]];
sleep(1);
//[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow: 1.0]];
}
void ErrorSheet (NSString * message1, NSString * message2,
@ -53,7 +54,8 @@ void ErrorSheet (NSString * message1, NSString * message2,
NSBeginCriticalAlertSheet(message1, button, nil, nil, window,
nil, nil, nil, NULL, message2);
while ( [window attachedSheet] )
[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow: 1.0]];
sleep(1);
//[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow: 1.0]];
}
@ -90,6 +92,10 @@ void InfoSheet (NSString * message1, NSString * message2,
nil, nil, nil, NULL, message2);
}
void EndSheet (NSWindow * window)
{
[[window attachedSheet] close];
}
// Convert a frequency (i.e. updates per second) to a 60hz tick delay, and update prefs
int frequencyToTickDelay (float freq)