diff options
author | David Jeannot <djeannot24@gmail.com> | 2012-01-16 17:12:10 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2012-01-16 17:12:10 -0500 |
commit | 4464a8778de8a8d214548b7fe73da64c19b7a71c (patch) | |
tree | 0edc05ac1ef5728dbfc014dc516cd518ee80f0be /src | |
parent | 10ccf8df0c884dcc07b52fdd1bff77f149170dd2 (diff) | |
download | plan9port-4464a8778de8a8d214548b7fe73da64c19b7a71c.tar.gz plan9port-4464a8778de8a8d214548b7fe73da64c19b7a71c.tar.bz2 plan9port-4464a8778de8a8d214548b7fe73da64c19b7a71c.zip |
devdraw: on OS X, add menu items "hide" and "plumb devdraw(1)"
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/5505092
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/devdraw/cocoa-screen.m | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/src/cmd/devdraw/cocoa-screen.m b/src/cmd/devdraw/cocoa-screen.m index f27c41dd..c434c91f 100644 --- a/src/cmd/devdraw/cocoa-screen.m +++ b/src/cmd/devdraw/cocoa-screen.m @@ -182,6 +182,12 @@ static NSCursor* makecursor(Cursor*); servep9p(); [NSApp terminate:self]; } +- (void)plumbmanual:(id)arg +{ + if(fork() != 0) + return; + execl("plumb", "plumb", "devdraw(1)", nil); +} + (void)callflushwin:(id)arg{ flushwin();} - (void)calltogglefs:(id)arg{ togglefs();} @@ -1115,30 +1121,32 @@ static void makemenu(void) { NSMenu *m; - NSMenuItem *i,*i0; + NSMenuItem *i0,*i1; m = [NSMenu new]; - i0 = [NSMenuItem new]; - [m addItem:i0]; + i0 = [m addItemWithTitle:@"app" action:NULL keyEquivalent:@""]; + i1 = [m addItemWithTitle:@"help" action:NULL keyEquivalent:@""]; [NSApp setMainMenu:m]; [m release]; - m = [NSMenu new]; - - i = [[NSMenuItem alloc] initWithTitle:@"Full Screen" + m = [[NSMenu alloc] initWithTitle:@"app"]; + [m addItemWithTitle:@"Full Screen" action:@selector(calltogglefs:) keyEquivalent:@"f"]; - [m addItem:i]; - [i release]; - - i = [[NSMenuItem alloc] initWithTitle:@"Quit" + [m addItemWithTitle:@"Hide" + action:@selector(hide:) + keyEquivalent:@"h"]; + [m addItemWithTitle:@"Quit" action:@selector(terminate:) keyEquivalent:@"q"]; - [m addItem:i]; - [i release]; - [i0 setSubmenu:m]; - [i0 release]; + [m release]; + + m = [[NSMenu alloc] initWithTitle:@"help"]; + [m addItemWithTitle:@"Plumb devdraw(1)" + action:@selector(plumbmanual:) + keyEquivalent:@""]; + [i1 setSubmenu:m]; [m release]; } |