'How do I get rid of the default macOS menu items in wxWidgets?
"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);
Solution 1:[1]
As said in the comments, calling SetMenuBar()
on the frame first and then appending the menus fixed the issue.
Solution 2:[2]
In (not yet, but to be soon, released) wx 3.1.7 this won't happen by default any longer, as this issue just got resolved.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | arjndr |
Solution 2 | VZ. |