Repeated idel events fired intermittently by wx.TextCtrl?

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

Repeated idel events fired intermittently by wx.TextCtrl?

James Scholes
Hi,

While implementing idle event handling in a project, I noticed that
while focused on a wx.TextCtrl, idle events are sent repeatedly at a
steady rate.  This can be observed by running the attached sample -
While focus is on the text control, wx.Bell will sound repeatedly.  Once
focus has been moved to the button, this is not the case.  What's the
reasoning behind this?

For reference I'm running Python 3.6, Phoenix, Windows 7.

Thanks.
--
James Scholes
http://twitter.com/JamesScholes

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

idle.py (422 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Repeated idel events fired intermittently by wx.TextCtrl?

Tim Roberts
On May 20, 2017, at 6:46 AM, James Scholes <[hidden email]> wrote:
>
> While implementing idle event handling in a project, I noticed that
> while focused on a wx.TextCtrl, idle events are sent repeatedly at a
> steady rate.  This can be observed by running the attached sample -
> While focus is on the text control, wx.Bell will sound repeatedly.  Once
> focus has been moved to the button, this is not the case.  What's the
> reasoning behind this?

If I may be so bold, why do you care?

The idle handler is called when your message queue goes from "not empty" to "empty.  The text control has to draw and undraw the blinking text cursor.  That requires at least a timer tick.  After the timer tick is dispatched, the queue is empty again, and the idle handler is called.

Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Repeated idel events fired intermittently by wx.TextCtrl?

James Scholes
Tim Roberts wrote:
> The text control has to draw and undraw the blinking text cursor.  That requires at least a timer tick.  After the timer tick is dispatched, the queue is empty again, and the idle handler is called.

Makes sense, thanks.  I'm a screen reader user so the fact of the
blinking cursor didn't even occur to me.
--
James Scholes
http://twitter.com/JamesScholes

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.