blob: 7b514eba6fddf434cc94a599c1b7588654cc02f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#import "Document.h"
@implementation Document
- (id)init
{
self = [super init];
if (self) {
}
return self;
}
// TODO: Are window controllers deallocated automatically by the parent?
// [[NSWindowController alloc] initWithWindow:]?
- (void)makeWindowControllers
{
// DocumentWindowController *controller = [[DocumentWindowController alloc] init];
NSWindow *window = [[NSWindow alloc]
initWithContentRect:NSMakeRect(0, 0, 600, 500)
styleMask:
NSWindowStyleMaskTitled
| NSWindowStyleMaskClosable
| NSWindowStyleMaskMiniaturizable
| NSWindowStyleMaskResizable
backing:NSBackingStoreBuffered
defer:NO];
// [window setFrameAutosaveName:@"document"]; // document name?
NSWindowController *window_controller = [[NSWindowController alloc]
initWithWindow:window];
// [window_controller setShouldCascadeWindows:YES];
[self addWindowController:window_controller];
}
@end
|