Mercurial > osx-quasimode
changeset 30:9aa3c2fd0baf
Quasimode app now terminates on window.close().
author | Atul Varma <avarma@mozilla.com> |
---|---|
date | Mon, 12 Apr 2010 11:42:22 -0700 |
parents | 8615b4b2de0c |
children | 6b0b9b04057e |
files | Quasimode.m |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Quasimode.m Mon Apr 12 11:08:06 2010 -0700 +++ b/Quasimode.m Mon Apr 12 11:42:22 2010 -0700 @@ -12,6 +12,17 @@ #import "JavaScriptQuasimode.h" #import "QuasimodalEventTap.h" +@interface QuasimodeWindowDelegate : NSObject { +} +- windowWillClose:(NSNotification *)notification; +@end + +@implementation QuasimodeWindowDelegate +- windowWillClose:(NSNotification *)notification { + [NSApp terminate: self]; +} +@end + @implementation Quasimode - onEvent:(NSNotification *)notification { NSDictionary *info = [notification userInfo]; @@ -51,6 +62,8 @@ backing: NSBackingStoreBuffered defer: YES]; + [window setDelegate: [[QuasimodeWindowDelegate alloc] init]]; + view = [[WebView alloc] initWithFrame: rect frameName: nil groupName: nil];