I am currently working to get a wxWidgets based application initially written (and functioning) under Windows to work under linux.
Currently on the linux side, it appears that I am unable to set a value to a wxTextCtrl other than the default value (programmatically that is).
With the below code I create my wxTextCtrl and add it to the sizer in use: m_pMyTextCtrl = new wxTextCtrl( this, -1, "(n/a)" ); pMySizer->Add(m_pMyTextCtrl, 1, wxALL | wxALIGN_CENTER_VERTICAL | wxADJUST_MINSIZE, BORDER_SIZE );
And later retrieve a value from elsewhere and attempt to set the wxTextCtrl to use it: wxString s; s = wxString::Format( "%d", m_pDataStore->GetIntegerValue( 0 ) ); m_pMyTextCtrl->SetLabel( s );
I have also tried setting my own value such as: m_pMyTextCtrl->SetLabel( "T1" ) which also has no effect.
Any thoughts?
Note: This code seems to work fine under Windows.
As for versions: Fedora Core 2 GTK: 1.2.10 wxWidgets: 2.4.2 GCC: 3.3.3
Fortunate for me I have found the cause of my problem. SetLabel is not the proper call to make to set the value of a wxTextCtrl, instead SetValue is to be used. I didn’t notice this right away as I am new wxWidget and did not write the code I am trying to get working under linux.