libs-gui/Model/test.m
Adam Fedor 24c44dd051 Fix window mouseUp. Doc building
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14327 72102866-910b-0410-8b05-ffd578937521
2002-08-25 02:47:00 +00:00

49 lines
1.1 KiB
Objective-C

#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
int main (int argc, char** argv, char** env)
{
id pool = [NSAutoreleasePool new];
NSArray* arguments;
NSProcessInfo* processInfo;
NSString *model;
#ifdef LIB_FOUNDATION_LIBRARY
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
#endif
processInfo = [NSProcessInfo processInfo];
arguments = [processInfo arguments];
[NSApplication sharedApplication];
if ([arguments count] < 2)
{
model = @"test.gmodel";
if (![NSBundle loadNibNamed: model owner: NSApp])
{
printf ("Cannot load Interface Modeller file!\n");
exit (1);
}
}
else
{
NSDictionary *table;
table = [NSDictionary dictionaryWithObject: NSApp forKey: @"NSOwner"];
model = [arguments objectAtIndex: 1];
if (![NSBundle loadNibFile: model
externalNameTable: table
withZone: [NSApp zone]])
{
printf ("Cannot load Interface Modeller file!\n");
exit (1);
}
}
[[NSApplication sharedApplication] run];
printf ("exiting...\n");
[pool release];
exit (0);
return 0;
}