mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-20 18:32:17 +00:00
applied the patch of nicola
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@8541 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9d89925f00
commit
4d601bf8c6
1 changed files with 31 additions and 34 deletions
|
@ -15,36 +15,21 @@ void createMenu();
|
||||||
* Initialise and go!
|
* Initialise and go!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int main(int argc, const char *argv[]) {
|
int main(int argc, const char *argv[])
|
||||||
NSApplication *theApp;
|
{
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
AppController *controller;
|
AppController *controller;
|
||||||
|
|
||||||
#ifndef NX_CURRENT_COMPILER_RELEASE
|
[NSApplication sharedApplication];
|
||||||
initialize_gnustep_backend();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
theApp = [NSApplication sharedApplication];
|
|
||||||
|
|
||||||
createMenu();
|
createMenu();
|
||||||
|
|
||||||
controller = [[AppController alloc] init];
|
controller = [[AppController alloc] init];
|
||||||
[theApp setDelegate:controller];
|
[NSApp setDelegate:controller];
|
||||||
|
|
||||||
/*
|
|
||||||
* Go...
|
|
||||||
*/
|
|
||||||
|
|
||||||
[theApp run];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ...and finish!
|
|
||||||
*/
|
|
||||||
|
|
||||||
RELEASE(controller);
|
|
||||||
RELEASE(pool);
|
RELEASE(pool);
|
||||||
|
|
||||||
return 0;
|
return NSApplicationMain (argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
void createMenu()
|
void createMenu()
|
||||||
|
@ -59,7 +44,8 @@ void createMenu()
|
||||||
|
|
||||||
menu = [[NSMenu alloc] initWithTitle:APP_NAME];
|
menu = [[NSMenu alloc] initWithTitle:APP_NAME];
|
||||||
|
|
||||||
[menu addItemWithTitle:@"Info" action:@selector(showInfoPanel:) keyEquivalent:@""];
|
[menu addItemWithTitle:@"Info" action:@selector(showInfoPanel:)
|
||||||
|
keyEquivalent:@""];
|
||||||
[menu addItemWithTitle:@"Edit" action:action keyEquivalent:@""];
|
[menu addItemWithTitle:@"Edit" action:action keyEquivalent:@""];
|
||||||
[menu addItemWithTitle:@"Windows" action:action keyEquivalent:@""];
|
[menu addItemWithTitle:@"Windows" action:action keyEquivalent:@""];
|
||||||
[menu addItemWithTitle:@"Services" action:action keyEquivalent:@""];
|
[menu addItemWithTitle:@"Services" action:action keyEquivalent:@""];
|
||||||
|
@ -68,16 +54,28 @@ void createMenu()
|
||||||
|
|
||||||
info = AUTORELEASE([[NSMenu alloc] init]);
|
info = AUTORELEASE([[NSMenu alloc] init]);
|
||||||
[menu setSubmenu:info forItem:[menu itemWithTitle:@"Info"]];
|
[menu setSubmenu:info forItem:[menu itemWithTitle:@"Info"]];
|
||||||
[info addItemWithTitle:@"Info Panel..." action:@selector(showInfoPanel:) keyEquivalent:@""];
|
[info addItemWithTitle:@"Info Panel..."
|
||||||
[info addItemWithTitle:@"Preferences" action:@selector(showPrefPanel:) keyEquivalent:@""];
|
action:@selector(showInfoPanel:) keyEquivalent:@""];
|
||||||
|
[info addItemWithTitle:@"Preferences"
|
||||||
|
action:@selector(showPrefPanel:) keyEquivalent:@""];
|
||||||
[info addItemWithTitle:@"Help" action:action keyEquivalent:@"?"];
|
[info addItemWithTitle:@"Help" action:action keyEquivalent:@"?"];
|
||||||
|
|
||||||
edit = AUTORELEASE([[NSMenu alloc] init]);
|
edit = AUTORELEASE([[NSMenu alloc] init]);
|
||||||
[edit addItemWithTitle:@"Cut" action:action keyEquivalent:@"x"];
|
[edit addItemWithTitle:@"Cut"
|
||||||
[edit addItemWithTitle:@"Copy" action:action keyEquivalent:@"c"];
|
action:@selector(cut:)
|
||||||
[edit addItemWithTitle:@"Paste" action:action keyEquivalent:@"v"];
|
keyEquivalent:@"x"];
|
||||||
[edit addItemWithTitle:@"Delete" action:action keyEquivalent:@""];
|
[edit addItemWithTitle:@"Copy"
|
||||||
[edit addItemWithTitle:@"Select All" action:action keyEquivalent:@"a"];
|
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"]];
|
[menu setSubmenu:edit forItem:[menu itemWithTitle:@"Edit"]];
|
||||||
|
|
||||||
windows = AUTORELEASE([[NSMenu alloc] init]);
|
windows = AUTORELEASE([[NSMenu alloc] init]);
|
||||||
|
@ -95,12 +93,11 @@ void createMenu()
|
||||||
services = AUTORELEASE([[NSMenu alloc] init]);
|
services = AUTORELEASE([[NSMenu alloc] init]);
|
||||||
[menu setSubmenu:services forItem:[menu itemWithTitle:@"Services"]];
|
[menu setSubmenu:services forItem:[menu itemWithTitle:@"Services"]];
|
||||||
|
|
||||||
[[NSApplication sharedApplication] setMainMenu:menu];
|
[NSApp setMainMenu:menu];
|
||||||
[[NSApplication sharedApplication] setServicesMenu: services];
|
[NSApp setServicesMenu: services];
|
||||||
|
|
||||||
[menu update];
|
|
||||||
[menu display];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue