1 /* Example for use of GNU gettext.
2 Copyright (C) 2003 Free Software Foundation, Inc.
3 This file is in the public domain.
5 Source code of the AppController class. */
7 #include "AppController.h"
10 @implementation AppController
12 static NSDictionary *infoDict = nil;
16 NSMutableDictionary *defaults = [NSMutableDictionary dictionary];
18 [[NSUserDefaults standardUserDefaults] registerDefaults: defaults];
19 [[NSUserDefaults standardUserDefaults] synchronize];
40 - (void)applicationDidFinishLaunching:(NSNotification *)notif
44 - (BOOL)applicationShouldTerminate:(id)sender
49 - (void)applicationWillTerminate:(NSNotification *)notification
53 - (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName
57 - (void)showPrefPanel:(id)sender
61 - (void)showInfoPanel:(id)sender
66 NSBundle *bundle = [NSBundle mainBundle];
68 fp = [bundle pathForResource: @"Info-project" ofType: @"plist"];
69 infoDict = [[NSDictionary dictionaryWithContentsOfFile: fp] retain];
71 [[NSApplication sharedApplication] orderFrontStandardInfoPanelWithOptions: infoDict];
74 - (void)showHelloWindow:(id)sender
77 hello = [[Hello alloc] init];
79 [hello makeKeyAndOrderFront];