TextCtrl focus events in wxWidgets

Peter Decker pydecker at gmail.com
Wed Jul 19 08:17:25 EDT 2006


On 19 Jul 2006 04:55:24 -0700, Simon Hibbs <simon.hibbs at gmail.com> wrote:
>
> Frank Millman wrote:
>
> > Try self.PlantCtrl.Bind(wx.EVT_KILL_FOCUS, self.OnUpdatePlantCtrl)
>
> And Voila! It works. Many, many thanks.
>
> Any idea what is going on?

Your first attempt used self.Bind, which binds the kill focus event of
self to the method. This version binds the kill focus event of the
*text control* to the method, which is what you want.

I used to get bitten by this a lot, but now I've switched to using the
dabo.ui module of Dabo to do my GUI stuff. It has the concept of
binding changes in controls to update events, which was needed for
database-type apps, but you can bind a control to any property of any
object. You should really check it out if you need this sort of
interactive updating in your app. http://dabodev.com.

-- 

# p.d.



More information about the Python-list mailing list