-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHeadLessAppDelegate.m
39 lines (24 loc) · 944 Bytes
/
HeadLessAppDelegate.m
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
39
#import "HeadLessAppDelegate.h"
#import "MainView.h"
#import <Cocoa/Cocoa.h>
@implementation HeadLessAppDelegate
@synthesize window = _window;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSRect frame = NSMakeRect( 100., 100., 300., 300. );
NSWindow *window = [[NSWindow alloc]
initWithContentRect:frame
styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask
backing:NSBackingStoreBuffered
defer:false];
[window setTitle:@"Testing"];
MainView *view = [[[MainView alloc] initWithFrame:frame] autorelease];
[window setContentView:view];
[window setDelegate:view];
[window makeKeyAndOrderFront:nil];
NSRect tframe = NSMakeRect(40, 200, 80, 30);
NSTextView *textLabel = [[NSTextView alloc] initWithFrame:tframe];
[textLabel setString:@"Testapp without NIV"];
[view addSubview:textLabel];
[textLabel release];
}
@end