Update tool to use GUI and NSApplication

This commit is contained in:
Gregory John Casamento 2023-06-04 21:03:21 -04:00
parent bc6e15abb7
commit e1c1ea54d9
4 changed files with 30 additions and 3 deletions

View file

@ -0,0 +1,4 @@
#import <Foundation/NSObject.h>
@interface AppDelegate : NSObject
@end

View file

@ -0,0 +1,4 @@
#import "AppDelegate.h"
@implementation AppDelegate
@end

View file

@ -8,9 +8,14 @@ PACKAGE_NAME = gormtool
TOOL_NAME = gormtool
gormtool_HEADER_FILES =
gormtool_OBJC_FILES = main.m
gormtool_OBJC_FILES = main.m AppDelegate.m
ADDITIONAL_TOOL_LIBS = \
-lGormCore \
-IInterfaceBuilder \
-lgnustep-base \
-lgnustep-gui
ADDITIONAL_TOOL_LIBS = -lGormCore -IInterfaceBuilder
ADDITIONAL_LIB_DIRS = -L../../GormCore/obj -L../../InterfaceBuilder/obj
ADDITIONAL_INCLUDE_DIRS = -I../../

View file

@ -1,12 +1,26 @@
// main.m
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import <GormCore/GormCore.h>
#import <InterfaceBuilder/InterfaceBuilder.h>
#import "AppDelegate.h"
int main(int argc, char **argv)
{
puts("-- gormtool");
NSApplication *app = [NSApplication sharedApplication];
AppDelegate *delegate = [[AppDelegate alloc] init];
extern char **environ;
[NSProcessInfo initializeWithArguments: (char **)argv
count: argc
environment: environ];
[app setDelegate: delegate];
[app run];
return 0;
}