Handle GUI quit correctly.
This commit is contained in:
@@ -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 )
|
||||||
|
|||||||
Reference in New Issue
Block a user