Home > Software design >  How do I get rid of the default macOS menu items in wxWidgets?
How do I get rid of the default macOS menu items in wxWidgets?

Time:03-20

"Toggle Sidebar" is the only item I have added, how do I remove the other items which I don't really need? I'm stuck

I'm on macOS 12.2 with wxWidgets v3.1.5

here's the code I used to add the menu:

wxMenuBar *mainMenuBar = new wxMenuBar();
wxMenu *viewMenu = new wxMenu();
viewMenu->Append(wxID_ANY, "Toggle Sidebar");
mainMenuBar->Append(viewMenu, "&View");
this->SetMenuBar(mainMenuBar);

enter image description here

CodePudding user response:

As said in the comments, calling SetMenuBar() on the frame first and then appending the menus fixed the issue.

  • Related