diff --git a/gui_ocamlmsgAppDelegate.m b/gui_ocamlmsgAppDelegate.m index ae9601a..532adad 100644 --- a/gui_ocamlmsgAppDelegate.m +++ b/gui_ocamlmsgAppDelegate.m @@ -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