How to get wxTextCtrl text from wxNotebook

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
antonkoetzler
Earned a small fee
Earned a small fee
Posts: 23
Joined: Fri May 21, 2021 3:58 am

How to get wxTextCtrl text from wxNotebook

Post by antonkoetzler »

I'm trying to create my own text editor program. For everytime a new tab is created, this is executed:

Code: Select all

typingArea->AddPage(new typingPanel(typingArea), "new", true);
typingPanel is just a modified wxTextCtrl for custom fonts and such... I'm having trouble extracting this wxTextCtrl's information when I have to save the file. I've tried wxNotebook->GetPageText(...) however this only returns the tab's name.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to get wxTextCtrl text from wxNotebook

Post by doublemax »

Code: Select all

typingPanel *tp = (typingPanel *)m_notebook->GetCurrentPage();
wxLogMessage("text: %s", tp->GetValue() );
Use the source, Luke!
Post Reply