Re: Re: Re: Re: Problem on updating a lot of text ctrl with attached event

Hello Michael Moriarity:
  Thank you for your help! Your idea is better than mine.
I raised the previous question was just for getting idea from all of you.
In fact, after getting idea from you, my problem had been solved.

  Thanks !!

···

Hello:
What I meant in my first post is that I think you are better off to forget
the whole idea of enabling and disabling the handlers, and just make
the handler smart enough to not do whatever it regularly does in cases
where you are merely placing database values into the text controls.
If you really think you need to do all this enabling and disabling of
event handlers, then I can't help you.

On 10/1/05, Tang Tim Hei <timheit@netvigator.com> wrote:
> Hello,
> As I know from document, the EVT_TEXT respond to the
> EVT_COMMAND_TEXT_UPDATED event. How can I temporarily disable the EVT_COMMAND_TEXT_UPDATED event so that EVT_TEXT will not receive signal from this event?
> Also am I correct that, the deletion of EVT_TEXT event before setting value to text ctrl will stop the detection of value update to the text ctrl?
>
> >
> > 寄件者: Michael Moriarity <datasmith@gmail.com>
> > 日期: 2005/10/01 星期六 下午 09:00:01 HKT
> > 收件者: wxPython-users@lists.wxwidgets.org
> > 主旨: Re: [wxPython-users] Problem on updating a lot of text ctrl with attached event
> >
> > Hello:javascript:submitform1('send')
> javascript:submitform1('send')
> >
> > I would suggest that you create a boolean member variable
> > and use it to test whether you should respond to the EVT_TEXT
> > in your handler. Sometthing like this.
> >
> > During initialization:
> >
> > self.boolHandleEvtText = True
> >
> > Then, when you want to do your updates:
> >
> > self.boolHandleEvtText = False
> > self.SetTextValues()
> > self.boolHandleEvtText = True
> >
> > And, in the handler:
> >
> > def OnEvtText(self, objEvent):
> > if not self.boolHandleEvtText:
> > return
> >
> > # Do event processing here.
> > self.FilterInput()
> >
> >
> >
> > On 9/30/05, Tang Tim Hei <timheit@netvigator.com> wrote:
> > > Hi,
> > > I'm using wxPython 2.6.1 under win32 or even 2.4.2 before. I have a serious
> > > problem can not be solved.
> > > I'm writing a database program which has a lot of text controls to set value by
> > > database data.
> > > I also need to set a lot of wx.EVT_TEXT events to text controls to detect user
> > > input.
> > > The problem is that it takes a very long time to show up the filled-data form.
> > > I found that the source of problem is from the event of ctrl. I tried the
> > > following 3 methods, but they are all failed.
> > > The steps for each method listed below:
> > >
> > > 1.
> > > o. set the wx.EVT_TEXT event to all text ctrls
> > > o. use SetValue() to all text ctrls.
> > >
> > > 2.
> > > o. delete all wx.EVT_TEXT event for all text ctrls
> > > o. use Setvalue() to all text ctrls.
> > > o. re-insert wx.EVT_TEXT event for each text ctrl
> > >
> > > 3.
> > > o. use Freeze() to fix the screen
> > > o. disable all text ctrls
> > > o. set value to all text ctrls
> > > o. re-enable all text ctrls
> > > o. use Thaw() to update the screen
> > >
> > > For the method 1, it is absolutely failed.
> > > For the method 2 and 3, if I just delete the event or disable the ctrl before
> > > setting value to text ctrl without further re-enable
> > > the EVT_TEXT event, the problem had gone. But whenever I re-insert EVT_TEXT to
> > > text ctrl or re-enable text ctrl,
> > > the problem come out immediately.
> > >
> > > Can anyone point out why this problem and the way to solve it?
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> > > For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> > For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
>
>