;ò ¿k¡@c@sádkZdkZdkiiZdZdZdZdZ dZ dei fd„ƒYZ dei fd „ƒYZd „Zd Zed joPdkZdkZdkZeid eiieidƒgeidƒndS(NsÕThis demo shows the various ways that wx.Timers can be used in your code. Just select one of the buttons in the left column to start a timer in the indicated way, and watch the log window below for messages printed when the timer event or callback happens. Clicking the corresponding button on the right will stop that timer. Since timers are not owned by any other wx object you should hold on to a reference to the timer until you are completely finished with it. s¦Binding an event handler to the wx.EVT_TIMER event is the prefered way to use the wx.Timer class directly. It makes handling timer events work just like normal window events. You just need to specify the window that is to receive the event in the wx.Timer constructor. If that window needs to be able to receive events from more than one timer then you can optionally specify an ID for the timer and the event binding. swx.FutureCall is a convenience class for wx.Timer. You just specify the timeout in milliseconds and a callable object, along with any ard or keyword arg you woudl like to be passed to your callable, and wx.FutureCall takes care of the rest. If you don't need to get the return value of the callable or to restart the timer then there is no need to hold a reference to this object. soIf you derive a class from wx.Timer and give it a Notify method then it will be called when the timer expires. sþwx.PyTimer is the old way (a kludge that goes back all the way to the first version of wxPython) to bind a timer directly to a callable. You should migrate any code that uses this method to use EVT_TIMER instead as this may be deprecated in the future. s TestPanelcBsttZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z d „Z d „Z d „Z RS( NcCs<||_tii||dƒtitiƒ}ti |dddti ƒ}|i tidtitititƒƒ|i|iƒƒ|itiƒ|i|dtitiBdƒ|iti |dtƒdtitiBdƒ|iti|dƒdtiƒ|iddfƒti|ddƒ}ti|dd ƒ} ti |dt ƒ}| i"ƒ|i#ti$|i%|ƒ|i#ti$|i&| ƒ|i#ti'|i(ƒti|dd ƒ} ti|dd ƒ} ti |dt+ƒ}| i"ƒ|i#ti$|i-| ƒ|i#ti$|i.| ƒti|dd ƒ}ti|dd ƒ}ti |dt1ƒ}|i"ƒ|i#ti$|i3|ƒ|i#ti$|i4|ƒti|dd ƒ}ti|dd ƒ} ti |dt7ƒ}| i"ƒ|i#ti$|i9|ƒ|i#ti$|i:| ƒ| |_| |_*||_0| |_6ti;d dddddƒ} | i|ƒ| i| ƒ| i|ƒ| i| ƒ| i| ƒ| i|ƒ| i|ƒ| i|ƒ| i|ƒ| i|ƒ| i| ƒ| i|ƒ|i| dtitiBdƒ|i=|ƒ|i>ƒdS(Niÿÿÿÿswx.Timersstyleiiiis EVT_TIMERs stop timers wx.FutureCalls self.Notifys wx.PyTimerscolsishgapi svgap(?slogsselfssps ScrolledPanels__init__sparentswxsBoxSizersVERTICALs outsideSizers StaticTexts ALIGN_CENTREstextsSetFontsFontsSWISSsNORMALsBOLDsFalsesSetSizes GetBestSizesSetForegroundColoursBLUEsAddsEXPANDsALLsheaders ALIGN_CENTERs StaticLinesButtonst1b1st1b2sdoc1st1stsDisablesBinds EVT_BUTTONs OnTest1Starts OnTest1Stops EVT_TIMERs OnTest1Timerst2b1st2b2sdoc2st2sts OnTest2Starts OnTest2Stopst3b1st3b2sdoc3st3sts OnTest3Starts OnTest3Stopst4b1st4b2sdoc4st4sts OnTest4Starts OnTest4Stops FlexGridSizersfgssSetSizersSetupScrolling(sselfsparentslogstextst3stst2stst1stst3b1st4b1st2b1st2b2sfgsst4b2st1b2st1b1st3b2st4sts outsideSizer((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys__init__4sp + /"                      cCsCti|ƒ|_|iidƒ|iidƒ|iiƒdS(NièsEVT_TIMER timer started ( swxsTimersselfst1sStartslogswritest1b2sEnable(sselfsevt((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys OnTest1Start„scCs4|iiƒ|iidƒ|`|iiƒdS(NsEVT_TIMER timer stoped (sselfst1sStopslogswritest1b2sDisable(sselfsevt((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys OnTest1StopŠs cCs|iidƒdS(Nsgot EVT_TIMER event (sselfslogswrite(sselfsevt((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys OnTest1Timersc CsNtid|idddddddƒ|_|iid ƒ|iiƒdS( NièsasbscsoneistwoisFutureCall scheduled ( swxs FutureCallsselfs OnTest2Timerst2slogswritest2b2sEnable(sselfsevt((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys OnTest2Start—scCsG|iiƒ|iidt|iiƒƒƒ|`|iiƒdS(Ns.FutureCall stopped, last return value was: %s ( sselfst2sStopslogswritesreprs GetResultst2b2sDisable(sselfsevt((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys OnTest2Stop¡s #cOs5|iid||fƒ|iiddƒdSdS(Ns*FutureCall called with args=%s, kwargs=%s iÜs restartedsThis is my return value(sselfslogswritesargsskwst2sRestart(sselfsargsskw((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys OnTest2Timer¨scCsCt|iƒ|_|iidƒ|iidƒ|iiƒdS(NièsNotifyTimer timer started (s NotifyTimersselfslogst3sStartswritest3b2sEnable(sselfsevt((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys OnTest3Start¹scCs4|iiƒ|iidƒ|`|iiƒdS(NsNotifyTimer timer stoped (sselfst3sStopslogswritest3b2sDisable(sselfsevt((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys OnTest3Stop¿s cCsFti|iƒ|_|iidƒ|iidƒ|ii ƒdS(Nièswx.PyTimer timer started ( swxsPyTimersselfs OnTest4Timerst4sStartslogswritest4b2sEnable(sselfsevt((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys OnTest4StartÌscCs4|iiƒ|iidƒ|`|iiƒdS(Nswx.PyTimer timer stoped (sselfst4sStopslogswritest4b2sDisable(sselfsevt((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys OnTest4StopÒs cCs|iidƒdS(Nsgot wx.PyTimer event (sselfslogswrite(sself((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys OnTest4TimerØs(s__name__s __module__s__init__s OnTest1Starts OnTest1Stops OnTest1Timers OnTest2Starts OnTest2Stops OnTest2Timers OnTest3Starts OnTest3Stops OnTest4Starts OnTest4Stops OnTest4Timer(((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys TestPanel3s P        s NotifyTimercBstZd„Zd„ZRS(NcCstii|ƒ||_dS(N(swxsTimers__init__sselfslog(sselfslog((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys__init__ãscCs|iidƒdS(Nsgot NotifyTimer event (sselfslogswrite(sself((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pysNotifyçs(s__name__s __module__s__init__sNotify(((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys NotifyTimerâs cCst||ƒ}|SdS(N(s TestPanelsnbslogswin(sframesnbslogswin((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pysrunTestîss®

wx.Timer

The wx.Timer class allows you to execute code at specified intervals from within the wxPython event loop. Timers can be one-shot or repeating. This demo shows the principle method of using a timer (with events) as well as the convenient wx.FutureCall class. Also there are two other usage patterns shown here that have been preserved for backwards compatibility. s__main__sii(stimeswxswx.lib.scrolledpanelslibs scrolledpanelsspsheadersdoc1sdoc2sdoc3sdoc4s ScrolledPanels TestPanelsTimers NotifyTimersrunTestsoverviews__name__ssyssossrunsmainspathsbasenamesargv(ssyssspsrunsoss NotifyTimersdoc2sdoc3sdoc1sdoc4srunTestsheaderstimes TestPanelsoverviewswx((se/mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Timer.pys?s    ¯