Thursday, August 5, 2010

AIR Flex NativeMenu bug?

I think I have discovered a bug with the AIR native menu. I may be doing something that was not expected but here is what I am doing.

Let me set the stage. I have a Flex based workbench application that creates a basic native menu (File, Help, etc.). The application allows the user to install and launch various plugins using Christian Cantrell's example as an approach. When the user loads a plugin, the plugin contributes a menu item that I add to the main application's native menu. All works fine up until this point. The plugin can dispatch an event that exits the plugin module, which I capture in the main application. I unload the plugin and remove the contributed menu item from the main app's menu. Here is where the bug rears it's ugly head. The menu item only partially gets removed from the main menu. The resulting behavior is that the main menu still shows the plugin's menu item, but it appears to be disabled as clicking on it does nothing. Now for the really weird part. If you deactivate the window by minimizing it or activating another application, the phantom menu item disappears.

There doesn't seem to be any way to trigger the refresh of the menu programmatically.

No comments: