define app delegate

master
Jordan Orelli 8 years ago
parent 353929978e
commit 1c3612e33f

@ -0,0 +1,5 @@
#import <AppKit/AppKit.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@end

@ -0,0 +1,30 @@
#import "AppDelegate.h"
@implementation AppDelegate
- (void) applicationWillFinishLaunching:(NSNotification *)notification {
NSLog(@"applicationWillFinishLaunching");
}
- (void) applicationDidFinishLaunching:(NSNotification *)notification {
NSLog(@"applicationDidFinishLaunching");
}
// Application Termination -----------------------------------------------------
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
NSLog(@"applicationShouldTerminate");
return NSTerminateNow;
}
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
NSLog(@"applicationShouldTerminateAfterLastWindowClosed");
return YES;
}
- (void)applicationWillTerminate:(NSNotification *)notification {
NSLog(@"applicationWillTerminate");
}
@end

@ -1,9 +1,11 @@
#include <Cocoa/Cocoa.h> #include <Cocoa/Cocoa.h>
#include "AppDelegate.h"
void void
Initialize(void) { Initialize(void) {
[NSAutoreleasePool new]; [NSAutoreleasePool new];
[NSApplication sharedApplication]; [NSApplication sharedApplication];
[NSApp setDelegate: [AppDelegate new]];
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
} }

Loading…
Cancel
Save