Hi,
I'm trying to add simple blank wxFlatNotebook page to the Editor (something like wxSmith does), but with this code:
class PluginTest : public cbPlugin
{
(...)
private:
DECLARE_EVENT_TABLE();
void OnMenuClick(wxCommandEvent& event);
wxFlatNotebook* m_Notebook;
wxPanel* m_Panel;
};
//-------------------------------------------------------------------------------------------
static int NewPanelId = wxNewId();
void PluginTest::OnMenuClick(wxCommandEvent& event)
{
Manager::Get()->GetMessageManager()->Log(_("\nPluginTest::OnMenuClick() clicked.\n"));
m_Notebook = Manager::Get()->GetEditorManager()->GetNotebook();
//wxFlatNotebook* Notebook = Manager::Get()->GetProjectManager()->GetNotebook();
if (m_Notebook)
{
Manager::Get()->GetMessageManager()->Log(_("\nManager::Get()->GetProjectManager()->GetNotebook() == TRUE\n"));
m_Panel = new wxPanel(m_Notebook, NewPanelId, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER);
m_Notebook->AddPage(m_Panel, _("Testing, testing..."));
}
}
I have alot of "crash" messageboxes (endless-loop?) when I click on newly created page.

Could somebody tell me (in simple words please

, I'm wxWidgets newbie) what is wrong with my code?