wxpython: how does EVT_IDLE work?

Rob Williscroft rtw at freenet.co.uk
Mon Jul 10 17:20:40 EDT 2006


John Salerno wrote in news:Wjysg.2445$No6.49710 at news.tufts.edu in 
comp.lang.python:

> Quick question about the code below: I understand why the progress bar 
> fills up at a steady pace when the mouse is idle over the frame; but 
> why, when you move the mouse, does the progress bar speed up? Shouldn't 
> it stop completely until the mouse is idle again?

wxWidgets is sending the idle event after it has processed all 
other events, but it just sends it once not in a loop.

see the documentation (help) for wxIdleEvent::RequestMore.


> 
>      def OnIdle(self, event):

    	    	event.RequestMore(True)

>          self.count += 1
>          if self.count >= 50:
>              self.count = 0

Rob.
-- 
http://www.victim-prime.dsl.pipex.com/



More information about the Python-list mailing list