#include <AppKit/AppKit.h>


@interface MyView : NSView
@end

@implementation MyView

- (void) drawRect:(NSRect)rect
{
	[[NSColor greenColor] set];
	NSRectFill (rect);
}

@end

int
main(int argc, char **argv, char** env)
{
id pool = [NSAutoreleasePool new];
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
NSArray *arguments = [processInfo arguments];
// int i, count;

	if ([arguments count] != 2) 
		{
		printf("usage: %s <mib-file>\n", [[processInfo processName] cString]);
		printf ("	*specify an absolute path\n");
		exit (1);
		}

	fprintf (stderr,"starting mib test...\n");
	if (![GMModel loadMibFile:[arguments objectAtIndex:1]
				  owner:[NSApplication sharedApplication]]) 
		{
		printf ("Cannot load Interface Modeller file!\n");
		exit (1);
		}

	[NSApp updateWindows];					// to all visible windows
	[[NSApplication sharedApplication] run];
	printf ("exiting...\n");
	
	[pool release];
	exit (0);
}
