gnustep-GSCommander-0.1/000075500000000000000000000000001227735572100152055ustar00rootroot00000000000000gnustep-GSCommander-0.1/AppController.h000064400000000000000000000020731227735572100201440ustar00rootroot00000000000000/* * AppController.h created by phr on 2000-08-27 11:38:59 +0000 * * Project TestApp * * Created with ProjectCenter - http://www.gnustep.org * * $Id: AppController.h,v 1.1.1.1 2001/12/30 12:42:37 probert Exp $ */ #import @class Command; @interface AppController : NSObject { NSTimeInterval interval; NSTimer *timer; NSTextField *timeField; NSTextField *commandField; NSTextView *output; NSButton *activeButton; NSWindow *window; Command *command; } + (void)initialize; - (id)init; - (void)dealloc; - (void)awakeFromNib; - (void)applicationDidFinishLaunching:(NSNotification *)notif; - (BOOL)applicationShouldTerminate:(id)sender; - (void)applicationWillTerminate:(NSNotification *)notification; - (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName; - (void)showPrefPanel:(id)sender; - (void)showInfoPanel:(id)sender; - (void)setCommand:(id)sender; - (void)setTimeInterval:(id)sender; - (void)activateCommand:(id)sender; - (void)executeCommand; @end gnustep-GSCommander-0.1/AppController.m000064400000000000000000000167601227735572100201610ustar00rootroot00000000000000/* * AppController.m created by phr on 2000-08-27 11:38:58 +0000 * * Project TestApp * * Created with ProjectCenter - http://www.gnustep.org * * $Id: AppController.m,v 1.1.1.1 2001/12/30 12:42:37 probert Exp $ */ #import "AppController.h" #import "Command.h" @interface AppController (InterfaceCreation) - (void)_createInterface; @end @implementation AppController (InterfaceCreation) - (void)_createInterface { unsigned int style = NSTitledWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask; NSView *view; NSRect frame; NSTextField *tf; NSScrollView *scrollView; frame = NSMakeRect(100,100,480,224); window = [[NSWindow alloc] initWithContentRect:frame styleMask:style backing:NSBackingStoreBuffered defer:NO]; [window setDelegate:self]; [window setTitle:@"GNUstep Unix Commander"]; [window setMinSize:NSMakeSize(480,224)]; [window setReleasedWhenClosed:NO]; view = [window contentView]; tf = [[NSTextField alloc] initWithFrame:NSMakeRect(16,8,56,21)]; [tf setStringValue:@"Command"]; [tf setAlignment: NSRightTextAlignment]; [tf setBordered: NO]; [tf setEditable: NO]; [tf setBezeled: NO]; [tf setDrawsBackground:NO]; [view addSubview:tf]; RELEASE(tf); commandField = [[NSTextField alloc] initWithFrame:NSMakeRect(80,8,360,21)]; [commandField setAlignment: NSLeftTextAlignment]; [commandField setBordered: NO]; [commandField setEditable: YES]; [commandField setBezeled: YES]; [commandField setDrawsBackground: YES]; [commandField setAction:@selector(setCommand:)]; [view addSubview:commandField]; RELEASE(commandField); tf = [[NSTextField alloc] initWithFrame:NSMakeRect(16,32,56,21)]; [tf setStringValue:@"Interval"]; [tf setAlignment: NSRightTextAlignment]; [tf setBordered: NO]; [tf setEditable: NO]; [tf setBezeled: NO]; [tf setDrawsBackground:NO]; [view addSubview:tf]; RELEASE(tf); timeField = [[NSTextField alloc] initWithFrame:NSMakeRect(80,32,40,21)]; [timeField setAlignment: NSLeftTextAlignment]; [timeField setBordered: NO]; [timeField setEditable: YES]; [timeField setBezeled: YES]; [timeField setDrawsBackground: YES]; [timeField setAction:@selector(setTimeInterval:)]; [view addSubview:timeField]; RELEASE(timeField); activeButton = [[NSButton alloc] initWithFrame:NSMakeRect(136,35,160,15)]; [activeButton setTitle:@"Activate timed execution"]; [activeButton setButtonType:NSSwitchButton]; [activeButton setBordered:NO]; [activeButton setTarget:self]; [activeButton setAction:@selector(activateCommand:)]; [activeButton setContinuous:NO]; [view addSubview:activeButton]; [activeButton sizeToFit]; RELEASE(activeButton); scrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect (0,64,480,160)]; [scrollView setHasHorizontalScroller:NO]; [scrollView setHasVerticalScroller:YES]; [scrollView setBorderType:NSBezelBorder]; [scrollView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; output = [[NSTextView alloc] initWithFrame:[[scrollView contentView] frame]]; [output setFont:[NSFont userFixedPitchFontOfSize:12]]; [output setRichText:NO]; [output setEditable:NO]; [output setSelectable:YES]; [output setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [output setBackgroundColor:[NSColor whiteColor]]; [[output textContainer] setWidthTracksTextView:YES]; [[output textContainer] setHeightTracksTextView:YES]; [output setHorizontallyResizable: NO]; [output setVerticallyResizable: YES]; [output setMinSize: NSMakeSize (0, 0)]; [output setMaxSize: NSMakeSize (1E7, 1E7)]; [[output textContainer] setContainerSize: NSMakeSize([output frame].size.width,1e7)]; [[output textContainer] setWidthTracksTextView:YES]; [scrollView setDocumentView:output]; [view addSubview:scrollView]; RELEASE(scrollView); RELEASE(output); } @end @implementation AppController static NSDictionary *infoDict = nil; + (void)initialize { NSMutableDictionary *defaults = [NSMutableDictionary dictionary]; /* * Register your app's defaults here by adding objects to the * dictionary, eg * * [defaults setObject:anObject forKey:keyForThatObject]; * */ [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; [[NSUserDefaults standardUserDefaults] synchronize]; } - (id)init { if ((self = [super init])) { [self _createInterface]; interval = 20; [timeField setStringValue:@"20"]; } return self; } - (void)dealloc { RELEASE( window ); if( [timer isValid] ) { [timer invalidate]; } [super dealloc]; } - (void)awakeFromNib { } - (void)applicationDidFinishLaunching:(NSNotification *)notif { [window center]; [window makeKeyAndOrderFront:self]; } - (BOOL)applicationShouldTerminate:(id)sender { return YES; } - (void)applicationWillTerminate:(NSNotification *)notification { } - (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName { return NO; } - (void)showPrefPanel:(id)sender { } - (void)showInfoPanel:(id)sender { [[NSApplication sharedApplication] orderFrontStandardInfoPanel:sender]; } - (void)setCommand:(id)sender { NSString *comStr = [sender stringValue]; NSArray *tokens = [comStr componentsSeparatedByString:@" "]; NSString *path; NSString *token; NSMutableArray *args; int argCount; if( comStr == nil || [comStr isEqualToString:@""] ) { NSRunAlertPanel(@"Attention!", @"This is not a valid command!", @"OK",nil,nil); return; } path = [tokens objectAtIndex:0]; if( [path isEqualToString:@""] ) { NSRunAlertPanel(@"Attention!", @"This is not a valid command!", @"OK",nil,nil); return; } // Now get all the arguemtns without any leading dash(es). This is a little // hacky, but it works for now...:-) argCount = [tokens count]; args = [NSMutableArray array]; if( argCount > 1 ) { int i; for( i=1; i Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02111, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. gnustep-GSCommander-0.1/CVS/000075500000000000000000000000001227735572100156405ustar00rootroot00000000000000gnustep-GSCommander-0.1/CVS/Entries000064400000000000000000000011111227735572100171660ustar00rootroot00000000000000/AppController.h/1.1.1.1/Sun Dec 30 12:42:37 2001// /AppController.m/1.1.1.1/Sun Dec 30 12:42:37 2001// /COPYING/1.1.1.1/Sun Dec 30 12:42:37 2001// /Command.h/1.1.1.1/Sun Dec 30 12:42:37 2001// /Command.m/1.1.1.1/Sun Dec 30 12:42:37 2001// /GNUmakefile/1.1.1.1/Sun Dec 30 12:42:37 2001// /GSCommander.tiff/1.1.1.1/Sun Dec 30 12:42:37 2001// /GSCommanderInfo.plist/1.1.1.1/Sun Dec 30 12:42:37 2001// /PC.project/1.1.1.1/Sun Dec 30 12:42:37 2001// /README/1.1.1.1/Sun Dec 30 12:42:37 2001// /main.m/1.1.1.1/Sun Dec 30 12:42:37 2001// D/Documentation//// D/English.lproj//// D/Images//// gnustep-GSCommander-0.1/CVS/Repository000064400000000000000000000000141227735572100177350ustar00rootroot00000000000000GSCommander gnustep-GSCommander-0.1/CVS/Root000064400000000000000000000000171227735572100165040ustar00rootroot00000000000000/usr/local/cvs gnustep-GSCommander-0.1/Command.h000064400000000000000000000012641227735572100167370ustar00rootroot00000000000000/* * Command.h created by probert on 2001-12-29 17:36:44 +0000 * * Project GSCommander * * Created with ProjectCenter - http://www.gnustep.org * * $Id: Command.h,v 1.1.1.1 2001/12/30 12:42:37 probert Exp $ */ #ifndef _COMMAND_H_ #define _COMMAND_H_ #import @interface Command : NSObject { NSString *command; NSTask *task; NSMutableArray *args; NSPipe *pipe; NSFileHandle *fileHandle; NSTextView *output; } - (id)initWithCommand:(NSString *)comm args:(NSArray *)arguments; - (void)dealloc; - (void)setTextView:(NSTextView *)view; - (void)log:(NSNotification *)aNotif; - (void)executeCommand; - (void)stop; @end #endif // _COMMAND_H_ gnustep-GSCommander-0.1/Command.m000064400000000000000000000041611227735572100167430ustar00rootroot00000000000000/* * Command.m created by probert on 2001-12-29 17:36:43 +0000 * * Project GSCommander * * Created with ProjectCenter - http://www.gnustep.org * * $Id: Command.m,v 1.1.1.1 2001/12/30 12:42:37 probert Exp $ */ #import "Command.h" @implementation Command - (id)initWithCommand:(NSString *)comm args:(NSArray *)arguments { if( self = [super init] ) { args = RETAIN(arguments); command = RETAIN(comm); } return self; } - (void)dealloc { RELEASE(args); RELEASE(command); [[NSNotificationCenter defaultCenter] removeObserver:self]; [super dealloc]; } - (void)setTextView:(NSTextView *)view { AUTORELEASE(output); output = RETAIN(view); [output setString:@""]; } - (void)log:(NSNotification *)aNotif { NSData *data; if((data = [fileHandle availableData])) { NSString *s = [[NSString alloc] initWithData:data encoding:[NSString defaultCStringEncoding]]; [output replaceCharactersInRange:NSMakeRange([[output string] length],0) withString:s]; [output replaceCharactersInRange:NSMakeRange([[output string] length],0) withString:@"\n"]; } } - (void)executeCommand { if( output == nil ) { NSRunAlertPanel(@"Attention!", @"No output view available!",@"OK",nil,nil); return; } [output setString:@""]; pipe = [[NSPipe alloc] init]; fileHandle = [pipe fileHandleForReading]; RETAIN(fileHandle); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(log:) name:NSFileHandleDataAvailableNotification object:fileHandle]; task = [[NSTask alloc] init]; [task setArguments:args]; [task setLaunchPath:command]; [task setStandardOutput:pipe]; [task setStandardError:pipe]; [fileHandle waitForDataInBackgroundAndNotify]; [task launch]; [task waitUntilExit]; [[NSNotificationCenter defaultCenter] removeObserver:self]; RELEASE(fileHandle); RELEASE(pipe); RELEASE(task); task = nil; } - (void)stop { if( task && [task isRunning] ) { [task terminate]; [[NSNotificationCenter defaultCenter] removeObserver:self]; if( output ) { RELEASE( output ); output = nil; } } } @end gnustep-GSCommander-0.1/Documentation/000075500000000000000000000000001227735572100200165ustar00rootroot00000000000000gnustep-GSCommander-0.1/Documentation/CVS/000075500000000000000000000000001227735572100204515ustar00rootroot00000000000000gnustep-GSCommander-0.1/Documentation/CVS/Entries000064400000000000000000000000021227735572100217750ustar00rootroot00000000000000D gnustep-GSCommander-0.1/Documentation/CVS/Repository000064400000000000000000000000321227735572100225460ustar00rootroot00000000000000GSCommander/Documentation gnustep-GSCommander-0.1/Documentation/CVS/Root000064400000000000000000000000171227735572100213150ustar00rootroot00000000000000/usr/local/cvs gnustep-GSCommander-0.1/English.lproj/000075500000000000000000000000001227735572100177235ustar00rootroot00000000000000gnustep-GSCommander-0.1/English.lproj/CVS/000075500000000000000000000000001227735572100203565ustar00rootroot00000000000000gnustep-GSCommander-0.1/English.lproj/CVS/Entries000064400000000000000000000000021227735572100217020ustar00rootroot00000000000000D gnustep-GSCommander-0.1/English.lproj/CVS/Repository000064400000000000000000000000321227735572100224530ustar00rootroot00000000000000GSCommander/English.lproj gnustep-GSCommander-0.1/English.lproj/CVS/Root000064400000000000000000000000171227735572100212220ustar00rootroot00000000000000/usr/local/cvs gnustep-GSCommander-0.1/GNUmakefile000064400000000000000000000017141227735572100172620ustar00rootroot00000000000000# # GNUmakefile - Generated by ProjectCenter # Written by Philippe C.D. Robert # # NOTE: Do NOT change this file -- ProjectCenter maintains it! # # Put all of your customisations in GNUmakefile.preamble and # GNUmakefile.postamble # include $(GNUSTEP_MAKEFILES)/common.make # # Subprojects # # # Main application # PACKAGE_NAME=GSCommander APP_NAME=GSCommander GSCommander_APPLICATION_ICON=GSCommander.tiff # # Additional libraries # ADDITIONAL_GUI_LIBS += # # Resource files # GSCommander_RESOURCE_FILES= \ GSCommanderInfo.plist \ README \ COPYING \ GSCommander.tiff # # Header files # GSCommander_HEADERS= \ AppController.h \ Command.h # # Class files # GSCommander_OBJC_FILES= \ main.m \ AppController.m \ Command.m # # C files # GSCommander_C_FILES= -include GNUmakefile.preamble -include GNUmakefile.local include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/application.make -include GNUmakefile.postamble gnustep-GSCommander-0.1/GSCommander.tiff000064400000000000000000000225121227735572100202200ustar00rootroot00000000000000II*$>>>D~~~{{{www{}zlnice`_a^^_c`afZ[]STVJKMPRQnpoccc##%**,((&*+&00.$#).-3****+%*+%01+/0+12-01+23.01,//-(((111+++113((*))+%'$ *,)$&%!!   ^]b ***#!$#)$$&(((002-+632:***,-'*+%23-./)23-./)12,12-//-,,*///...///--/..0+-,"$#"#%!!""*" !# @BA&&&"!)-+6+)4.-3/.30/542?*(576>87<438;;=55788833166477500.886**(664((&442220!!!..0/.4*)1%"! (  +++rqvpn{wuus~mlt_^f][iEBS:8E:8C97B>=E=D>=BA@E<<>>>@==?BBD>>@CCEGGIOOQ[Z_fekigr~|~|##% &$%,*+ '$3)#%        !% #*% %/-0*()0.1%")SO`UPgWRiWRfXTc\Xf[Vj[Vl]ZoYVi]ZmYVi`]n\Yjb_pcao`^l[Ygc`qYVgc`qVSd^[l[Yg_]hSQ\[XmZWlUS^TS[PM`XUf))+!!!+)*1/0;9<%MH\UOiWQkTOe_[jWSbSO`hczYTtgaZUuc^|c_z_[r\Yl  XTkTPgTS[ ROd !!!/-.320:8;ZUka[wSMiXSj[Wf^ZhgcrWRhe`~\Wwb]{`\wa]vjg|_\m  gc~\Xqe^VRi###$$$444886<<>RNeSOjWSn      ^Wy^Wyd]|e^d`yNJc ))''''!!!;;;>>=9;:?A@9;:=?>;=<@B?@B?<>=HJG?A>BDA=?NMO~k~__a...uuuLLLs/.4//1()!>?9<;CKIT@@@_`[RRPRRPWWYaaa`b_ac^^`[dfa]_Z`b]Z\W]_Z]_ZSURUWRTVQGIDPRMIKF ! utvsq}~{z{xzz}""#QQQ34.01+76;BAGLLJGHCQRMQRMYYWNNLVWRRUNYZUUWR\]XRTOTUPOQLOQLYYWRTOQSNMNI@B=885KKKun;~{|{}~|{{~ssvgggYYY&&&++)..,::<;;=CCCHHFQQOQQORRRNNNVVTYYWYXVVVTWVTRRPQPNVVTVVTUSTPPNNNLHGELLJ-,+hhhD$M1bP|||}}}{{{xxzsst222BBBiiimlmkkkkkkkkkmmmkkkL;zWKooolllllllllkkkkkk}}},,,C(((kkkmmmpppkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk}}}000 kkkmlllihL;"ҾD-kkkkkkkkkkkkkkkkTTT(((*()kkklll.-H1kkkkkkkkTTT(((J-O0./1/0/-.A?@/-.1/0978867312.,-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$;;; 5555340.//-.3124232010./2015340.//-.312423201QPQQQQOOOOOOVVVPPPOOOIIIZZZLLLTRSPNONLMRPQSQRQOPPNOQOPTRSPNONLMRPQSQRQOPPNOQOPMMMRRRPPPUUUMMMWWWOOOOOOQQQRRR&&&###!  !  !!!KKKQQQTTTMMMSSSUUU RRRQQQYYYQQQQQQTTTQQQIII4441111112011/00./1/02011/00./0./2011/00./1/02011/00./0./222666111MMM   00$ 5$$%@$:%B%(R/home/probert/Developer/GSCommander/GSCommander.tiffCreated with The GIMPHHgnustep-GSCommander-0.1/GSCommanderInfo.plist000064400000000000000000000006211227735572100212340ustar00rootroot00000000000000{ ApplicationDescription = "Unix command monitor"; ApplicationIcon = ""; ApplicationName = GSCommander; ApplicationRelease = 0.1; Authors = ("Philippe C.D. Robert "); Copyright = "Copyright (C) 2001 by Philippe C.D. Robert"; CopyrightDescription = "Released under the GNU GPL"; FullVersionID = 0.1; NOTE = "Automatically generated!"; URL = ""; } gnustep-GSCommander-0.1/Images/000075500000000000000000000000001227735572100164125ustar00rootroot00000000000000gnustep-GSCommander-0.1/Images/CVS/000075500000000000000000000000001227735572100170455ustar00rootroot00000000000000gnustep-GSCommander-0.1/Images/CVS/Entries000064400000000000000000000000021227735572100203710ustar00rootroot00000000000000D gnustep-GSCommander-0.1/Images/CVS/Repository000064400000000000000000000000231227735572100211420ustar00rootroot00000000000000GSCommander/Images gnustep-GSCommander-0.1/Images/CVS/Root000064400000000000000000000000171227735572100177110ustar00rootroot00000000000000/usr/local/cvs gnustep-GSCommander-0.1/PC.project000064400000000000000000000022151227735572100170770ustar00rootroot00000000000000{ APPCLASS = NSApplication; APPKIT = "GNUSTEP-GUI"; APPLICATIONICON = GSCommander.tiff; BUILDTOOL = gnumake; CLASS_FILES = ( main.m, AppController.m, Command.m ); COMPILEROPTIONS = ""; CREATION_DATE = ""; DOCU_FILES = ( ); FOUNDATION = "GNUSTEP-BASE"; FRAMEWORKS = ( ); HEADER_FILES = ( AppController.h, Command.h ); IMAGES = ( GSCommander.tiff ); INSTALLDIR = "$(HOME)/Apps"; INTERFACES = ( ); LANGUAGE = English; LAST_EDITING = ""; LIBRARIES = ( "gnustep-base", "gnustep-gui" ); MAININTERFACE = ""; MAKEFILEDIR = /usr/GNUstep/Makefiles; OTHER_FILES = ( ); OTHER_RESOURCES = ( GSCommanderInfo.plist, README, COPYING ); OTHER_SOURCES = ( ); PRINCIPAL_CLASS = main.m; PROJECT_BUILDER = PCAppProj; PROJECT_CREATOR = ""; PROJECT_DESCRIPTION = "No description avaliable!"; PROJECT_MAINTAINER = ""; PROJECT_NAME = GSCommander; PROJECT_TYPE = PCAppProject; PROJECT_VERSION = 1.0; SUBPROJECTS = ( ); SUPPORTING_FILES = ( GNUmakefile.preamble, GNUmakefile, GNUmakefile.postamble ); }gnustep-GSCommander-0.1/README000064400000000000000000000010211227735572100160570ustar00rootroot00000000000000GSCommander ----------- This is GSCommander, a simple unix command monitor for GNUstep. GSCommander is copyrighted and written by Philippe C.D. Robert. This application is inspired by CommandMon for NEXTSTEP, it was written a Saturday evening to test a new ProjectCenter release. GSCommander is released under the GNU GPL, see COPYING for more information. For a progress overview see the ChangeLog file. Send bug reports or code contributions to me (Philippe C.D. Robert): phr@3dkit.org gnustep-GSCommander-0.1/main.m000064400000000000000000000052771227735572100163220ustar00rootroot00000000000000/* $Id: main.m,v 1.1.1.1 2001/12/30 12:42:37 probert Exp $ */ #import #import "AppController.h" #define APP_NAME @"GNUstep" /* * Create the application's menu */ void createMenu(); /* * Initialise and go! */ int main(int argc, const char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; AppController *controller; [NSApplication sharedApplication]; createMenu(); controller = [[AppController alloc] init]; [NSApp setDelegate:controller]; RELEASE(pool); return NSApplicationMain (argc, argv); } void createMenu() { NSMenu *menu; NSMenu *info; NSMenu *edit; NSMenu *services; NSMenu *windows; SEL action = @selector(method:); menu = [[NSMenu alloc] initWithTitle:APP_NAME]; [menu addItemWithTitle:@"Info" action:@selector(showInfoPanel:) keyEquivalent:@""]; [menu addItemWithTitle:@"Edit" action:action keyEquivalent:@""]; [menu addItemWithTitle:@"Windows" action:action keyEquivalent:@""]; [menu addItemWithTitle:@"Services" action:action keyEquivalent:@""]; [menu addItemWithTitle:@"Hide" action:@selector(hide:) keyEquivalent:@"h"]; [menu addItemWithTitle:@"Quit" action:@selector(terminate:) keyEquivalent:@"q"]; info = AUTORELEASE([[NSMenu alloc] init]); [menu setSubmenu:info forItem:[menu itemWithTitle:@"Info"]]; [info addItemWithTitle:@"Info Panel..." action:@selector(showInfoPanel:) keyEquivalent:@""]; [info addItemWithTitle:@"Preferences" action:@selector(showPrefPanel:) keyEquivalent:@""]; [info addItemWithTitle:@"Help" action:action keyEquivalent:@"?"]; edit = AUTORELEASE([[NSMenu alloc] init]); [edit addItemWithTitle:@"Cut" action:@selector(cut:) keyEquivalent:@"x"]; [edit addItemWithTitle:@"Copy" action:@selector(copy:) keyEquivalent:@"c"]; [edit addItemWithTitle:@"Paste" action:@selector(paste:) keyEquivalent:@"v"]; [edit addItemWithTitle:@"Delete" action:@selector(delete:) keyEquivalent:@""]; [edit addItemWithTitle:@"Select All" action:@selector(selectAll:) keyEquivalent:@"a"]; [menu setSubmenu:edit forItem:[menu itemWithTitle:@"Edit"]]; windows = AUTORELEASE([[NSMenu alloc] init]); [windows addItemWithTitle:@"Arrange" action:@selector(arrangeInFront:) keyEquivalent:@""]; [windows addItemWithTitle:@"Miniaturize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; [windows addItemWithTitle:@"Close" action:@selector(performClose:) keyEquivalent:@"w"]; [menu setSubmenu:windows forItem:[menu itemWithTitle:@"Windows"]]; services = AUTORELEASE([[NSMenu alloc] init]); [menu setSubmenu:services forItem:[menu itemWithTitle:@"Services"]]; [NSApp setMainMenu:menu]; [NSApp setServicesMenu: services]; }