setMacMainMenu bug?


#1

I’ve implemented a MenuBarModel into my application using the IntroJucer code as an example. All works fine until I open and close a FileChooser window which causes the extra menu items added to the Apple menu to disappear, though the rest of my menu bar is still intact.

I’ve tested this within the IntroJucer code by adding/modifying the following code to the end of JucerApplication::initialise(), but the problem persists here too:

#if JUCE_MAC
        PopupMenu macMenu;
        macMenu.addItem(1001, "example 1");
        macMenu.addSeparator();
        macMenu.addItem(1002, "example 2");
        MenuBarModel::setMacMainMenu (menuModel, &macMenu);
#endif

Is this a bug? Or do I need to handle the the MenuBarModel object differently?
Thanks.


#2

Thanks for letting me know - try it again now!


#3

Thanks Jules, all fixed!