devdraw: cleanup, fix macargv

This commit is contained in:
Russ Cox 2011-10-12 13:18:32 -04:00
parent 0e881c054a
commit 7064acbd10
5 changed files with 63 additions and 23 deletions

34
src/cmd/devdraw/macargv.m Normal file
View file

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