ApplicationCommandTarget and MenuBarModel not displaying items

hey guys, really struggling with a ApplicationCommandManager and BarMenuModel situation,
where my items do not get displayed within the popupmenu. I can’t see what i’m missing and have been looking at this code for hours.

Here is the code for the BarMenuModel and the ApplicationCommandManager subclass:

BurgerMenu::BurgerMenu()
{
    setColour(PopupMenu::backgroundColourId, Colours::purple);
    burgerMenuComponent.setModel(this);
    setApplicationCommandManagerToWatch (&commandManager);
    
    commandManager.registerAllCommandsForTarget (this);
    commandManager.setFirstCommandTarget (this);
    
    mainPopupMenu.addCommandItem(&commandManager, CommandIDs::columnOne);
    mainPopupMenu.addCommandItem(&commandManager, CommandIDs::columnTwo);
    
}

BurgerMenu::~BurgerMenu()
{
    commandManager.setFirstCommandTarget (nullptr);
    burgerMenuComponent.setModel(nullptr);
}

StringArray BurgerMenu::getMenuBarNames()
{
       return { "Menu Sub-Header" };
}

PopupMenu BurgerMenu::getMenuForIndex (int topLevelMenuIndex, const String& menuName) 
   {

       return mainPopupMenu;
   };

void BurgerMenu::menuItemSelected (int menuItemID, int topLevelMenuIndex)
{
    // useless shit
};

void BurgerMenu::getAllCommands (Array<CommandID>& c)
{
    Array<CommandID> commands { CommandIDs::columnOne,
                                CommandIDs::columnTwo };
    c.addArray (commands);
}

void BurgerMenu::getCommandInfo (CommandID commandID, ApplicationCommandInfo& result)
{
    //bool tick = false;
    switch (commandID)
    {
        case CommandIDs::columnOne:
            result.setInfo ("Column 1", "Edit Col 1", "Menu", 0);
            std::cout << result.shortName << "\n";
            break;
            
        case CommandIDs::columnTwo:
            result.setInfo ("Column 2", "Edit Col 2", "Menu", 0);
            std::cout << result.shortName << "\n";
            break;
        default:
            break;
    }
}

bool BurgerMenu::perform (const InvocationInfo& info)
{
    switch (info.commandID)
    {
        case CommandIDs::columnOne:
            performAction();
            break;
        case CommandIDs::columnTwo:
            performAction();
            break;
            
        default:
            return false;
    }
    return true;
}

The SidePanel that ‘hosts’ the PopupMenu works fine, and the Sub-Header (MenuBar name) gets displayed fine, it simply does not display the CommandItems, I have tried debugging and apparently the parameters in getAllCommands and getCommandInfo are passed properly, nothing missing there.

Please HE LP! :sob: :sob: :sob:

What if you try to add a regular item, does it get displayed than?

Hey, thanks for your reply! I’ve sorted it - in the end something was happening with the order in which the various elements where initialized/constructed… I managed to fix it by putting burgerMenu.setModel(this) at the end of the class constructor