Thanks Jens, that was it.
Do someone knows why the code for recreating the menu is something like this:
SetMenuBar(0L);
mbar = new wxMenuBar;
FillTheMenuBar(mbar);
SetMenuBar(mbar);
I'm asking because I'm using Manager::Get()->GetAppWindow()->GetMenuBar() to create the debug menu, not the wxMenuBar supplied to the BuildMenu method.
And I get a crash because the menubar is NULL while menu recreation.
Edit:
Another issue I have is that I can't create the debugger toolbar from the sdk.
At the moment every plugin should implement the BuildToolbar method, which fill pre-supplied toolbar with some content. This means that every plugin has one toolbar that is unique.
I want to have only one debugger toolbar, that is shared by all debugger plugins.
What I've tried so far:
void DebuggerToolbarHandler::LoadToolbar()
{
if(m_toolbar)
return;
m_toolbar = Manager::Get()->CreateEmptyToolbar();
wxString my_16x16 = Manager::isToolBar16x16(m_toolbar) ? _T("_16x16") : _T("");
Manager::AddonToolBar(m_toolbar, wxString(_T("debugger_toolbar")) + my_16x16);
// m_toolbar->Realize();
m_toolbar->SetInitialSize();
// m_toolbar->Show();
wxAuiManager* layout = Manager::Get()->GetAppMainFrame()->GetLayoutManager();
layout->AddPane(m_toolbar, wxAuiPaneInfo().
Name(_T("Debugger Toolbar")).Caption(_("Debugger Toolbar")).
ToolbarPane().Top().Row(1));
Manager::Get()->GetAppMainFrame()->DoUpdateLayout();
}
/// Manager::Get()->GetAppMainFrame() returns:
class IMainFrame
{
public:
virtual wxAuiManager* GetLayoutManager() = 0;
virtual void DoUpdateLayout() = 0;
};
// that is implemented by the MainFrame class in main.cpp
The toolbar is created but it is not shown. I know that because I was calling layout->Update instead of DoUpdateLayout and some strange window have been shown while CB was starting, then disappears.