TextCtrl focus events in wxWidgets
Steve Holden
steve at holdenweb.com
Wed Jul 19 05:52:01 EDT 2006
Simon Hibbs wrote:
> I have a simple form with some input values and some calculated values
> in TextCtrl widgets.
>
> What I would like to do is have the display update automaticaly when
> the user changes one of the input fields, without having to click on a
> 'Calculate' button. I was thinking of having an update triggered when
> one of the text Controlls loses focus, indicating that the user has
> finished changing it's value.
>
> I don't want to do an update on every character entry, as this would
> create a lot of bogus/meaningless updates. There doesn't seem to be
> such an event. Any ideas how I could implement this, or a similarly
> user friendly behaviour?
>
It should be quite simple: you need to handle EVT_SET_FOCUS and/or
EVT_KILL_FOCUS events (documented in the wxPython docs) to know when to
recaclulate the values. Sounds like that should be enough of a hint to you.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden
More information about the Python-list
mailing list