[SIMPLE] Get content from wxTextCtrl? Topic is solved

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
IdkxD
In need of some credit
In need of some credit
Posts: 3
Joined: Mon Aug 24, 2009 10:08 am

[SIMPLE] Get content from wxTextCtrl?

Post by IdkxD »

Well i even feel ashamed asking that but i became tired and mad trying searching a method for getting the content from wxTextCtrl....

FACT1: yes i'm a newbi at wxwidget, I just started learning it today....
upCASE
Moderator
Moderator
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE »

OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
IdkxD
In need of some credit
In need of some credit
Posts: 3
Joined: Mon Aug 24, 2009 10:08 am

Post by IdkxD »

i saw the article already but i don't really understand it.... could you post some example for this poor newbi? :S
upCASE
Moderator
Moderator
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE »

Hi!
IdkxD wrote:i saw the article already but i don't really understand it....
What exactly do you not understand? It 's hard to answer the question if we don't know the exact problem.

Code: Select all

...
//create a text control.
//this -> parent window
//wxID_ANY -> auto-assign ID
//the text to be shown initially
wxTextCtrl* text = new wxTextCtrl(this,wxID_ANY,"This is the value of the text field");
//get the text and store it in a wxString
wxString str = text->GetValue();
//pop up a message box with the obtained text
wxMessageBox(str);
//set some new text
text->SetValue("Some other text.");
...
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
IdkxD
In need of some credit
In need of some credit
Posts: 3
Joined: Mon Aug 24, 2009 10:08 am

Post by IdkxD »

upCASE wrote:Hi!
IdkxD wrote:i saw the article already but i don't really understand it....
What exactly do you not understand? It 's hard to answer the question if we don't know the exact problem.
OMG i got it now thanks for being that patient with me, thanks really for the example <3 WXWIDGET _/
Post Reply