Domanda

I'm using Adobe AIR 3.9 to create a desktop app for Windows. I'm using a native menu for the navigation. How to enable and disable those native menu buttons?

The menu code:

stage.nativeWindow.menu = new NativeMenu(); 
stage.nativeWindow.menu.addEventListener(Event.SELECT, selectCommandMenu); 
fileMenu = stage.nativeWindow.menu.addItem(new NativeMenuItem("Menu")); 
fileMenu.submenu = createFileMenu(); 

 var fileMenu:NativeMenu = new NativeMenu(); 
 fileMenu.addEventListener(Event.SELECT, selectCommandMenu); 
 newCommand = fileMenu.addItem(new NativeMenuItem("Contact")); 
 newCommand.addEventListener(Event.SELECT, setContact); 
 newCommand.keyEquivalent = "n";
È stato utile?

Soluzione

OK, just found it: Use fileMenu.enabled = false to disable the menu.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top