Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Frank Millman
David Hughes wrote: > > AIUI, wx.EVT_KILL_FOCUS is not a Command Event i.e. it doesn't > propagate up the hierarchy of widgets until it gets handled, so it has > to be bound explicitly to the control itself, as above. > Right. This is one of the sources of confusion with events - which ones 'pro

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Frank Millman
Simon Hibbs wrote: > Frank Millman wrote: > > > Try self.PlantCtrl.Bind(wx.EVT_KILL_FOCUS, self.OnUpdatePlantCtrl) > > And Voila! It works. Many, many thanks. > My pleasure > Any idea what is going on? I only understand it in simple terms, though it can get complex. Here is my simple explanatio

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Peter Decker
On 19 Jul 2006 04:55:24 -0700, Simon Hibbs <[EMAIL PROTECTED]> 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

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread David Hughes
Simon Hibbs 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? AIUI, wx.EVT_KILL_FOCUS is not a Command Event i.e. it doesn't propagate up the hierarchy of widgets until i

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Simon Hibbs
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? Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Steve Holden
Simon Hibbs wrote: > Steve Holden wrote: > > >>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. > > > I've tried that, but it

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Frank Millman
Simon Hibbs wrote: > Steve Holden wrote: > > > 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. > > I've tried that, but it

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Simon Hibbs
Simon Hibbs wrote: > rony steelandt wrote: > > Since the event handler of a textctrl inherits from wxCommandEvent, > > I would guess that the binding should be to EVT_COMMAND_KILL_FOCUS > > Still not working :( I can trap EVT_TEXT_ENTER events successfuly, without using EVT_COMMAND_ENTER. This al

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Simon Hibbs
rony steelandt wrote: > Since the event handler of a textctrl inherits from wxCommandEvent, > I would guess that the binding should be to EVT_COMMAND_KILL_FOCUS Still not working :( Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread rony steelandt
Since the event handler of a textctrl inherits from wxCommandEvent, I would guess that the binding should be to EVT_COMMAND_KILL_FOCUS Not tested... Rony Le Wed, 19 Jul 2006 03:15:36 -0700, Simon Hibbs a écrit : > > Steve Holden wrote: > >> It should be quite simple: you need to handle EVT

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Simon Hibbs
Steve Holden wrote: > 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. I've tried that, but it doesn't work. Here is the test

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Steve Holden
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