mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 06:21:09 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14327 72102866-910b-0410-8b05-ffd578937521
49 lines
1.1 KiB
Objective-C
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;
|
|
}
|
|
|