Event from TextCtrl when user changes value

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Event from TextCtrl when user changes value

David Wende
I realize that EVT_TEXT can be used to trigger a text change within a
TextCtrl, however
I need to do something whenever ONLY the user changes the value. The
reason is, that
sometimes I programmatically change the value of the TextCtrl and I
then do NOT want
to cause this event to be triggered.

Is there any easy way to do this?
Thanks
David

--
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wxPython-users?hl=en
Reply | Threaded
Open this post in threaded view
|

Re: Event from TextCtrl when user changes value

Mike Driscoll


On Aug 5, 9:10 am, dubiboy <[hidden email]> wrote:

> I realize that EVT_TEXT can be used to trigger a text change within a
> TextCtrl, however
> I need to do something whenever ONLY the user changes the value. The
> reason is, that
> sometimes I programmatically change the value of the TextCtrl and I
> then do NOT want
> to cause this event to be triggered.
>
> Is there any easy way to do this?
> Thanks
> David

If you don't want the event to be triggered by your code, then use
ChangeValue instead of SetValue.

-------------------
Mike Driscoll

Blog:   http://blog.pythonlibrary.org

--
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wxPython-users?hl=en
Reply | Threaded
Open this post in threaded view
|

Re: Event from TextCtrl when user changes value

GadgetSteve
In reply to this post by David Wende


--------------------------------------------------
From: "dubiboy" <[hidden email]>
Sent: Thursday, August 05, 2010 3:10 PM
To: "wxPython-users" <[hidden email]>
Subject: [wxPython-users] Event from TextCtrl when user changes value

> I realize that EVT_TEXT can be used to trigger a text change within a
> TextCtrl, however
> I need to do something whenever ONLY the user changes the value. The
> reason is, that
> sometimes I programmatically change the value of the TextCtrl and I
> then do NOT want
> to cause this event to be triggered.
>
> Is there any easy way to do this?

David,
If you have to use SetValue how about checking the IsModified flag in your
event handler and not doing the processing if it returns false?  Also the
ChangeValue method is supposed to not raise the EVT_COMMAND_TEXT_UPATED
event.

Gadget/Steve


> Thanks
> David
>
> --
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wxPython-users?hl=en
>

--
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wxPython-users?hl=en