Close app on window close
This commit is contained in:
parent
d26233998c
commit
83da5ad0f1
|
@ -19,6 +19,12 @@
|
||||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
||||||
task = [NSTask new];
|
task = [NSTask new];
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter]
|
||||||
|
addObserver: self
|
||||||
|
selector: @selector(mainWindowClosed:)
|
||||||
|
name: NSWindowWillCloseNotification
|
||||||
|
object: window];
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
addObserver: self
|
addObserver: self
|
||||||
selector: @selector(taskStatusChanged:)
|
selector: @selector(taskStatusChanged:)
|
||||||
|
@ -83,4 +89,8 @@
|
||||||
[NSApp terminate: self];
|
[NSApp terminate: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) mainWindowClosed: (NSNotification *) aNotification {
|
||||||
|
[NSApp terminate: self];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue