Reputation: 31
Already I created a Mac app for my site but I can't find any guide on how to edit the Menu Bar items.
The only results I get are on how to make a status bar application.
I'd like to add items to the app's Main Menu: App Name | File | Edit | View | etc.
How can I add items to the main menu bar menu and then trigger actions when selected?
Upvotes: 1
Views: 1612
Reputation: 11
Apparently, for XCode 11, though you may think that the "menu bar" would be full of "menus," they are actually called "items." For each ITEM on the menu bar, you can have a menu associated.
Once you've managed to get your menu into the menu bar, it is easy enough to add menu items to it, move it, etc. I've found it easiest to drop the items into the hierarchical display of the xib
on the left rather than onto the menu bar picture in the main editor.
Upvotes: 1
Reputation: 6282
Just open MainMenu.xib
and in the left navigation area expand Menu(under Objects) and you can find all Menu Items that appear on top here.
To add your own menu item drag a new menu item to this main menu. There are a lot of options for you to choose from:
Edit the menu items and add Actions like how you do it for any other object in Xib.
Upvotes: 4