2 Replies Latest reply on Nov 18, 2010 2:16 PM by Hasan Otuome

    Native Menu behavior on Mac

    dkelly60

      Why does the Mac add extra File, Edit and Window menu items to programs?

       

      To see an example run the example for using native windows found here

       

      http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7de7.html

       

      You end up with

      ProgramName - File - Edit - Window - File - Edit

       

      instead of

      ProgramName - File - Edit

       

      In the example the last File and Edit are the menus for the program.

        • 1. Re: Native Menu behavior on Mac
          Joe ... Ward Level 4

          Those are the default menu items that you always get. The example should either replace the default submenus, or add the new commands to the existing submenus.

          1 person found this helpful
          • 2. Re: Native Menu behavior on Mac
            Hasan Otuome Level 1

            Here's an example of modifying the existing menu items and adding an additional menu item for OSX:

             

             

            // generate native menu for OSX

            if (NativeApplication.supportsMenu)

            {

            nativeMenu = NativeApplication.nativeApplication.menu;

            fileMenu = nativeMenu.getItemAt( 1 );

            fileMenu.submenu.removeAllItems();

            fileMenu.submenu = _generateFileMenu();

            editMenu = nativeMenu.getItemAt( 2 );

            editMenu.submenu.removeAllItems();

            editMenu.submenu = _generateEditMenu();

            exportMenu = nativeMenu.getItemAt( 3 );

            helpMenu = nativeMenu.addItem( new NativeMenuItem(HELP) );

            helpMenu.submenu = _generateHelpMenu();

            }

             

             

            To modify the root menu item just get the item @ 0 since it's 0-based...