Adding sub menu to Main menu in Cocoa

Discussion in 'Mac Programming' started by xmax, May 31, 2009.

  1. macrumors member

    Jul 3, 2008

    I was customizing Main Menu for my application and some how i deleted edit item from Main Menu. Now my application needs to put this Edit Menu in Main menu. I am not able to drag NSMenu directly to main menu from Interface builder.

    I am not able to insert this edit menu programmatically.
    So, how can i add "Edit" menu item in Main menu.

  2. macrumors 6502

    Nov 30, 2005
    You should be able to drag the "Edit Menu Item" (or any of the other menu items) directly onto the menu wherever you want it to be positioned. However, after a quick check, this doesn't work if you have any of the pull down menus in the menu you are editing currently open.
  3. macrumors 601


    Jan 6, 2004
    Western US
    Yeah, I think the naming is a little confusing. "Menu" refers to the entire thing (all individual drop-down menus together), and not an individual drop-down list as you might think — each of these is actually a "Menu Item", the same as each individual line in the list. So as Thomas says, drag a Menu Item onto the menu bar for a new drop-down list ("File", "Edit", etc.).
  4. thread starter macrumors member

    Jul 3, 2008
    Yeah, I did it. Naming was confusing me.


Share This Page