Page 1 of 1

[SIMPLE] Get content from wxTextCtrl?

Posted: Mon Aug 24, 2009 10:15 am
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....

Posted: Mon Aug 24, 2009 10:28 am
by upCASE

Posted: Tue Aug 25, 2009 3:35 am
by IdkxD
i saw the article already but i don't really understand it.... could you post some example for this poor newbi? :S

Posted: Tue Aug 25, 2009 6:44 am
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.");
...

Posted: Tue Aug 25, 2009 11:04 am
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 _/