C++ String Converting with wx
C++ String Converting with wx
I am stuck for 1 hour. Please help
Re: C++ String Converting with wx
It's not totally clear what you're lookin for. Converting an integer to a string?
https://wiki.wxwidgets.org/Converting_e ... o_wxString
https://wiki.wxwidgets.org/Converting_e ... o_wxString
Use the source, Luke!
Re: C++ String Converting with wx
So the problem is that the text is not changing its value after the button is being pressed and I don't know how to update that. Know something that would come in handy?
Re: C++ String Converting with wx
Hi,
What do you expect to to see as the label? The value of i? Anything else?
Just follow doublemax' suggestion and the call SetLabel() on the button with appropriate text.
Thank you.
What do you expect to to see as the label? The value of i? Anything else?
Just follow doublemax' suggestion and the call SetLabel() on the button with appropriate text.
Thank you.
Re: C++ String Converting with wx
Yes, the value of i. How do I use SetLabel()?
Re: C++ String Converting with wx
Code: Select all
m_button->SetLabel(labelText);
Re: C++ String Converting with wx
hey,
thanks for the help. but can I get the SetLabel() function explained a little bit more? The point is that I want to do a clicker game so if I click the 'get points' button the 'i' value gets +1 point and the StaticText prints out the 'i' value. Think you can help?
thanks for the help. but can I get the SetLabel() function explained a little bit more? The point is that I want to do a clicker game so if I click the 'get points' button the 'i' value gets +1 point and the StaticText prints out the 'i' value. Think you can help?
Re: C++ String Converting with wx
Just combine code from previous messages:
where widget is your wxStaticText.
Code: Select all
widget->SetLabel(wxString::Format("%i", i));