At 04:40 PM 1/7/2006 -0500, you wrote:
Subject pretty-much says it all.
In my application, I want to trigger a timer once per second to update a
pair of static text
objects on the display. (With the current sidereal time, for the curious).
Marcus - I stole this from Scandoo and use it all the time:
-----------
class UpdateTimer(wx.Timer):
def __init__(self, target, dur=1000):
wx.Timer.__init__(self)
self.target = target
self.Start(dur)
def Notify(self):
"""Called every timer interval"""
if self.target:
self.target.OnUpdate()
-------------------
# start a timer to check for web commands
self.timer = UpdateTimer(self, 1000) # every 1000 mSec, 1 Sec
-------------------
# timer events - check for web commands
def OnUpdate(self):
cmds = os.listdir("/var/www/cgi-bin/commands/")
<etc>
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio