From b513ebb9b83efda7e59ac0d1257f0ac23f4fe314 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 14 Aug 2023 02:19:59 +0200 Subject: Move application menu bar code to a new file Put the menu code in its own file to keep it more organised. We're also going to be adding a lot more code here for the base main menu. Wasn't sure if I should be releasing these menu objects, but it looks like the application works when I do release them, so maybe `setMainMenu` does a retain or copy. I can't decide if I should use C-style identifiers or Foundation-style in the menu file. --- src/AppDelegate.m | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/AppDelegate.m') diff --git a/src/AppDelegate.m b/src/AppDelegate.m index 270be25..86ba5f6 100644 --- a/src/AppDelegate.m +++ b/src/AppDelegate.m @@ -1,4 +1,5 @@ #import "AppDelegate.h" +#import "main_menu.h" @implementation AppDelegate @@ -10,6 +11,10 @@ - (void)applicationWillFinishLaunching:(NSNotification *)notification { + NSMenu *menubar = main_menu_create(); + [NSApp setMainMenu:menubar]; + [menubar release]; + _window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 400, 400) styleMask:NSWindowStyleMaskTitled -- cgit v1.2.3