Close app on window close

This commit is contained in:
Tony Garnock-Jones 2012-05-01 16:09:43 -04:00
parent d26233998c
commit 83da5ad0f1
1 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,12 @@
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
task = [NSTask new];
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(mainWindowClosed:)
name: NSWindowWillCloseNotification
object: window];
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(taskStatusChanged:)
@ -83,4 +89,8 @@
[NSApp terminate: self];
}
- (void) mainWindowClosed: (NSNotification *) aNotification {
[NSApp terminate: self];
}
@end