diff options
author | June McEnroe <programble@gmail.com> | 2018-02-11 18:59:49 -0500 |
---|---|---|
committer | June McEnroe <programble@gmail.com> | 2018-02-11 18:59:49 -0500 |
commit | b203da92184e0421703fcb74ad7c4f92537a6dbb (patch) | |
tree | c6ccfbda9310027a44defe7ba04bd411d3177831 /bin | |
parent | Tweak gfxx code style (diff) | |
download | src-b203da92184e0421703fcb74ad7c4f92537a6dbb.tar.gz src-b203da92184e0421703fcb74ad7c4f92537a6dbb.zip |
Add "Close Window" menu item to gfx/cocoa
Diffstat (limited to '')
-rw-r--r-- | bin/gfx/cocoa.m | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/gfx/cocoa.m b/bin/gfx/cocoa.m index 33252257..4837a386 100644 --- a/bin/gfx/cocoa.m +++ b/bin/gfx/cocoa.m @@ -121,13 +121,19 @@ int main(int argc, char *argv[]) { NSString *name = [[NSProcessInfo processInfo] processName]; NSMenu *menu = [NSMenu new]; - NSMenuItem *quit = [ - [NSMenuItem alloc] - initWithTitle: [@"Quit " stringByAppendingString: name] + [ + menu + addItemWithTitle: @"Close Window" + action: @selector(performClose:) + keyEquivalent: @"w" + ]; + [menu addItem: [NSMenuItem separatorItem]]; + [ + menu + addItemWithTitle: [@"Quit " stringByAppendingString: name] action: @selector(terminate:) keyEquivalent: @"q" ]; - [menu addItem: quit]; NSMenuItem *menuItem = [NSMenuItem new]; [menuItem setSubmenu: menu]; [NSApp setMainMenu: [NSMenu new]]; |