summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-02-11 18:59:49 -0500
committerJune McEnroe <june@causal.agency>2018-02-11 18:59:49 -0500
commit07b426f511a2a5c651c36cce59e6766a7e4e5553 (patch)
treeb9963703654ff2af1374fd2452def7a03192e8fd
parentTweak gfxx code style (diff)
downloadsrc-07b426f511a2a5c651c36cce59e6766a7e4e5553.tar.gz
src-07b426f511a2a5c651c36cce59e6766a7e4e5553.zip
Add "Close Window" menu item to gfx/cocoa
-rw-r--r--bin/gfx/cocoa.m14
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/gfx/cocoa.m b/bin/gfx/cocoa.m
index b511ff5a..91fce3db 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]];