m_pNotebook = new wxNotebook(this,
wxID_ANY,
wxDefaultPosition,
wxDefaultSize);
// Create a new text control using our member pointer.
m_pTextCtrl = new TextCtrl(m_pNotebook,
wxID_ANY,
wxEmptyString,
wxDefaultPosition,
wxDefaultSize,
wxTE_MULTILINE | wxHSCROLL);
m_pNotebook->InsertPage(m_pNotebook->GetPageCount(), m_pTextCtrl);
I get this error.
main.cpp:40: error: no matching function for call to `wxNotebook::InsertPage(size_t, TextCtrl*&)'
C:/wxWidgets-2.6.2/include/wx/msw/notebook.h:136: note: candidates are: virtual bool wxNotebook::InsertPage(size_t, wxNotebookPage*, const wxString&, bool, int)
TextCtrl is my own text control object derived from wxTextCtrl. I wan't to have a tabbed text editor..... How to? Sorry for the dumb question.... :P
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