This content has been marked as final. Show 3 replies
That's because addSubmenu() returns a NativeMenuItem, not a NativeMenu. To access its submenu, use fileMenu.submenu.
See http://livedocs.adobe.com/air/1/devappshtml/help.html?content=Menus_3.html for more.
Oliver Goldman | Adobe AIR Engineering
Thanks, but I guess I'm not following... where does my example differ from the example in the doc? (I actually copied it from there and just changed the names of the items).
First part I create the root.
Then I add a "File" submenu to the root.
Then I create a "Quit" command and (try to) add it to the file submenu, and that's where it fails.
If I change the last line to "fileMenu.subMenu.addItem(quitCommand);" It still fails, but with "TypeError: Undefined value"
Ok, I figured it out, but I used thte ColorMenu example instead. I still cannot get the main example (the referenced one) to work.
So to sum up, a menu does NOT have a submenu with a label.... a menu has a menu item with a submenu. Got it.
One other problem... keep in mind that I'm on a Mac... it seems that my root menu doesn't "activate" (i.e. show up as the "current application menu") when I put focus on the app. Instead, it shows up after the first alert shows.
I'll try to track this down in the morning, but if you have any suggestions, I'd appreciate them.