| 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 |