I’m currently writing a front end for a science app which needs the user to key in numbers for various parameters. I’m using a validator to catch the input from a TextCtrl, and shade it pink for invalid or default for valid, using SetBackgroundColour on the TextCtrl. However, the GUI’s not updating correctly. Please see the attached image file for an example.
State 1 is what happens when we start with all valid input.
State 2 is what happens when invalid data is entered in a widget. The background colour has changed, but the border is still white.
State 3 is what happens if you then mouse over the widget. The border is redrawn to match the background colour.
State 4 is what happens if you correct the value. The background colour is back to white, but the border is still pink.
If you mouse-over the widget in State 4, you’ll be back at State 1.
I’ve tried calling both Refresh and ClearBackground on the TextCtrl, but neither of them seems to work.
Any suggestions? I saw a similar thread from 2005 that came up with no solution, but said a patch would be going in at some point.
Windows XP 32-bit, Python 2.6.6, wxPython 2.8 Unicode.
Cheers,
Alex
