Handle GUI quit correctly.

This commit is contained in:
Steve Checkoway
2006-01-18 08:17:39 +00:00
parent fb0cb6b183
commit 635564b3fa
+7 -5
View File
@@ -21,6 +21,7 @@
} }
- (id) initWithArgc:(int)argc argv:(char **)argv; - (id) initWithArgc:(int)argc argv:(char **)argv;
- (void) startGame:(id)sender; - (void) startGame:(id)sender;
- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender;
@end @end
@@ -29,11 +30,6 @@
{ {
ArchHooks::SetToggleWindowed(); ArchHooks::SetToggleWindowed();
} }
// Invoked from the Quit menu item.
- (void)terminate:(id)sender
{
ArchHooks::SetUserQuit();
}
- (void)sendEvent:(NSEvent *)event - (void)sendEvent:(NSEvent *)event
{ {
@@ -66,6 +62,12 @@
{ {
[NSThread detachNewThreadSelector:@selector(startGame:) toTarget:self withObject:nil]; [NSThread detachNewThreadSelector:@selector(startGame:) toTarget:self withObject:nil];
} }
- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender
{
ArchHooks::SetUserQuit();
return NSTerminateCancel;
}
@end @end
static void HandleNSException( NSException *exception ) static void HandleNSException( NSException *exception )