You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
2.5 KiB
Matlab
75 lines
2.5 KiB
Matlab
8 years ago
|
#import "AppDelegate.h"
|
||
8 years ago
|
#import "MainWindowController.h"
|
||
8 years ago
|
|
||
8 years ago
|
@interface AppDelegate ()
|
||
|
|
||
|
@property (nonatomic, strong) MainWindowController *windowController;
|
||
|
|
||
|
@end
|
||
|
|
||
8 years ago
|
@implementation AppDelegate
|
||
|
|
||
8 years ago
|
// Application Startup ------------------------------------------------------{{{
|
||
|
|
||
8 years ago
|
- (void) applicationDidFinishLaunching:(NSNotification *)notification {
|
||
8 years ago
|
NSLog(@"[AppDelegate] Application Finished Launching");
|
||
8 years ago
|
[self createMenubar];
|
||
|
[self createMainWindow];
|
||
8 years ago
|
NSLog(@"[AppDelegate] activate NSApp");
|
||
8 years ago
|
[NSApp activateIgnoringOtherApps:YES];
|
||
8 years ago
|
|
||
8 years ago
|
}
|
||
|
|
||
8 years ago
|
// --------------------------------------------------------------------------}}}
|
||
|
// Application Termination --------------------------------------------------{{{
|
||
8 years ago
|
|
||
|
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
|
||
8 years ago
|
NSLog(@"[AppDelegate] applicationShouldTerminate sender: %@", sender);
|
||
8 years ago
|
return NSTerminateNow;
|
||
8 years ago
|
}
|
||
|
|
||
|
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
|
||
8 years ago
|
NSLog(@"[AppDelegate] applicationShouldTerminateAfterLastWindowClosed sender: %@", sender);
|
||
8 years ago
|
return YES;
|
||
8 years ago
|
}
|
||
|
|
||
|
- (void)applicationWillTerminate:(NSNotification *)notification {
|
||
8 years ago
|
NSLog(@"[AppDelegate] applicationWillTerminate notification sender: %@", notification);
|
||
8 years ago
|
}
|
||
|
|
||
|
// --------------------------------------------------------------------------}}}
|
||
|
// Menu Bar -----------------------------------------------------------------{{{
|
||
|
|
||
8 years ago
|
- (void) createMenubar {
|
||
8 years ago
|
NSLog(@"[AppDelegate] Creating Menubar");
|
||
8 years ago
|
|
||
8 years ago
|
id mainMenu = [[NSMenu alloc] autorelease];
|
||
8 years ago
|
[mainMenu initWithTitle:@"Main Menu"];
|
||
|
[NSApp setMainMenu:mainMenu];
|
||
8 years ago
|
|
||
8 years ago
|
id appMenuItem = [[NSMenuItem alloc] autorelease];
|
||
8 years ago
|
[appMenuItem initWithTitle:@"dws" action:NULL keyEquivalent:@""];
|
||
|
[mainMenu addItem:appMenuItem];
|
||
8 years ago
|
|
||
8 years ago
|
id appMenu = [[NSMenu alloc] autorelease];
|
||
8 years ago
|
[appMenu initWithTitle:@"dws"];
|
||
|
[appMenuItem setSubmenu:appMenu];
|
||
8 years ago
|
|
||
8 years ago
|
id quitMenuItem = [[NSMenuItem alloc] autorelease];
|
||
8 years ago
|
[quitMenuItem initWithTitle:@"Quit" action:@selector(terminate:) keyEquivalent:@"q"];
|
||
|
[appMenu addItem:quitMenuItem];
|
||
8 years ago
|
}
|
||
|
|
||
8 years ago
|
// --------------------------------------------------------------------------}}}
|
||
8 years ago
|
// Main Window --------------------------------------------------------------{{{
|
||
|
|
||
|
- (void) createMainWindow {
|
||
8 years ago
|
NSLog(@"[AppDelegate] Creating Main Window");
|
||
8 years ago
|
self.windowController = [[MainWindowController alloc] init];
|
||
|
[self.windowController showWindow:self];
|
||
8 years ago
|
}
|
||
|
|
||
|
// --------------------------------------------------------------------------}}}
|
||
8 years ago
|
@end
|
||
|
|