Usually it is better to use the notebook itself as the parent of the page.
In the wxFlatNotebook, for example, the control reparent the page when inserted to it:
AddPage(wxWindow* win, ... )
{
if(!win)
return;
win->Reparent(this);
}
to add text control:
to add a text control just do:
wxTextCtrl *text = new wxTextCtrl(m_pNotebook, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER | wxTE_MULTILINE);
m_pNotebook->AddPage(text, wxT("Page #1"));
Eran