Menu Bar Not Showing?


I’m trying to add a simple menu bar to my juce app following juce demo, but it’s not showing? Did the following

class HelloWorldContentComponent : public Component, public MenuBarModel . . ect

Then all the required pure virtuals

const PopupMenu getMenuForIndex(int menuIndex, const String&menuName)
menuItemSelected(int menuItemID,int topLevelMenuIndex)

The problem is no menu system comes up, what’s missing? Thanks…


You need to add something like this in your class constructor :

    setMacMainMenu (this);
    setMenuBar (this, 20);

The conditional is here to use a true system menu on Mac. Whithout it (ie doing only setMenuBar (this, 20)) then there is an extra menu attached to the main window, something that we don’t see ususally in a mac app

Hope this helps


cheers rbocquier! It’s showing now.