ui/cocoa/WindowManager.m

changeset 1174
8b8da1adef7d
parent 404
384f6d1f5784
child 1176
87a906a990e3
equal deleted inserted replaced
1173:ce0e443174d7 1174:8b8da1adef7d
42 - (WindowManager*)init { 42 - (WindowManager*)init {
43 _windows = [[NSMutableArray alloc] initWithCapacity:16]; 43 _windows = [[NSMutableArray alloc] initWithCapacity:16];
44 return self; 44 return self;
45 } 45 }
46 46
47 - (void)addWindow:(NSWindow*)win { 47 - (void)addWindow:(NSWindowController*)win {
48 [_windows addObject:win]; 48 [_windows addObject:win];
49 [win setDelegate:self];
50 } 49 }
51 50
52 - (void) windowWillClose:(NSNotification *) notification { 51 - (void)closeWindow:(NSWindow*)win {
53 NSWindow *window = notification.object; 52 [_windows removeObject:win.windowController];
54 [_windows removeObject:window];
55 } 53 }
56 54
57 @end 55 @end

mercurial