Changing wxTextCtrl's value doesn't change its visible text Topic is solved

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
denarced
Knows some wx things
Knows some wx things
Posts: 47
Joined: Sun Dec 04, 2011 7:25 am

Changing wxTextCtrl's value doesn't change its visible text

Post by denarced » Tue Jan 10, 2012 10:57 am

The title pretty much says it all.
I have tried using ChangeValue, SetValue, <<-operator. All of them change the value
for sure (another textCtrl reads it), but it doesn't become visible.
I have tried to apply Update and Refresh after changing the value but still no go.

Ideas ?

denarced
Knows some wx things
Knows some wx things
Posts: 47
Joined: Sun Dec 04, 2011 7:25 am

Re: Changing wxTextCtrl's value doesn't change its visible t

Post by denarced » Tue Jan 10, 2012 11:05 am

To the extent its relevant, this value changing takes place in a wxDialog's constructor.
The wxTextCtrl in question is an attribute of the dialog.

denarced
Knows some wx things
Knows some wx things
Posts: 47
Joined: Sun Dec 04, 2011 7:25 am

Re: Changing wxTextCtrl's value doesn't change its visible t

Post by denarced » Tue Jan 10, 2012 11:25 am

Executing the textCtrl's Clear method does not remove it's value.
Are the visible text and the control's value distinct entities ?
I can even use SetSelection() and Copy() to copy the value into the
Windows clipboard successfully.
This could have something to do with the wxTextValidator used.

denarced
Knows some wx things
Knows some wx things
Posts: 47
Joined: Sun Dec 04, 2011 7:25 am

Re: Changing wxTextCtrl's value doesn't change its visible t

Post by denarced » Tue Jan 10, 2012 11:53 am

Removing the used validator solved the problem.
Don't know why the validator also filtered the numerical data but it did.
Not when typing but when setting programmatically.

Post Reply