diff options
author | Russ Cox <rsc@swtch.com> | 2011-10-12 13:18:32 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2011-10-12 13:18:32 -0400 |
commit | 7064acbd104d7c1af5a94533213d2bb124a7a60e (patch) | |
tree | 748cbe0dc3520ff93ab3e38f605f03809412d34e /src/cmd/devdraw/macargv.m | |
parent | 0e881c054a76801032e640db3947e0602cfccbeb (diff) | |
download | plan9port-7064acbd104d7c1af5a94533213d2bb124a7a60e.tar.gz plan9port-7064acbd104d7c1af5a94533213d2bb124a7a60e.tar.bz2 plan9port-7064acbd104d7c1af5a94533213d2bb124a7a60e.zip |
devdraw: cleanup, fix macargv
Diffstat (limited to 'src/cmd/devdraw/macargv.m')
-rw-r--r-- | src/cmd/devdraw/macargv.m | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/cmd/devdraw/macargv.m b/src/cmd/devdraw/macargv.m new file mode 100644 index 00000000..cf3e2282 --- /dev/null +++ b/src/cmd/devdraw/macargv.m @@ -0,0 +1,34 @@ +#import <Cocoa/Cocoa.h> + +#include <u.h> +#include <libc.h> + +AUTOFRAMEWORK(Cocoa) + +@interface appdelegate : NSObject @end + +void +main(void) +{ + if(OSX_VERSION < 100700) + [NSAutoreleasePool new]; + + [NSApplication sharedApplication]; + [NSApp setDelegate:[appdelegate new]]; + [NSApp run]; +} + +@implementation appdelegate +- (void)application:(id)arg openFiles:(NSArray*)file +{ + int i,n; + NSString *s; + + n = [file count]; + for(i=0; i<n; i++){ + s = [file objectAtIndex:i]; + print("%s\n", [s UTF8String]); + } + [NSApp terminate:self]; +} +@end |