If your application name is, for example, MyFirstApp, then you need to create a file called MyFirstAppInfo.plist in your source directory (you do not need to add anything to your GNUmakefile; the make system looks for this file automatically). Here is an example of such a file:
{ ApplicationName = "My First Application"; ApplicationDescription = "An Example of how to use NSMenu"; ApplicationRelease = "0.1"; Authors = ("Your Name Here <your.name@your.domain>", "Another Name Here <another.name@another.domain>"); Copyright = "Copyright (c) 2008 Your Name Here <your.name@your.domain>"; CopyrightDescription = "This program is released under the GNU GPL"; }You should of course edit this example filling in with the information appropriate for your own app. The file is in a format called ``property list'' (that is why it has extension plist; see the Basic Foundation Classes GNUstep Mini Tutorial for more information on property lists). The entries should be self-explanatory; note that Authors should be equal to an array of names. If you want to omit some of the entries, you may safely do it.
Here is the full listing of our latest app source code, containing an info submenu able to display the Info Panel:
#include <Foundation/Foundation.h> #include <AppKit/AppKit.h> @interface MyDelegate : NSObject - (void) printHello: (id)sender; - (void) applicationWillFinishLaunching: (NSNotification *)not; @end @implementation MyDelegate : NSObject - (void) printHello: (id)sender { printf ("Hello!\n"); } - (void) applicationWillFinishLaunching: (NSNotification *)not { NSMenu *menu; NSMenu *infoMenu; NSMenuItem *menuItem; menu = AUTORELEASE ([NSMenu new]); infoMenu = AUTORELEASE ([NSMenu new]); [infoMenu addItemWithTitle: @"Info Panel..." action: @selector (orderFrontStandardInfoPanel:) keyEquivalent: @""]; [infoMenu addItemWithTitle: @"Help..." action: @selector (orderFrontHelpPanel:) keyEquivalent: @"?"]; menuItem = [menu addItemWithTitle: @"Info..." action: NULL keyEquivalent: @""]; [menu setSubmenu: infoMenu forItem: menuItem]; [menu addItemWithTitle: @"Print Hello" action: @selector (printHello:) keyEquivalent: @""]; [menu addItemWithTitle: @"Quit" action: @selector (terminate:) keyEquivalent: @"q"]; [NSApp setMainMenu: menu]; } @end int main (int argc, const char **argv) { [NSApplication sharedApplication]; [NSApp setDelegate: [MyDelegate new]]; return NSApplicationMain (argc, argv); }