On 2/2/12 5:48 PM, Ed Leafe wrote:
> On Feb 2, 2012, at 6:11 PM, Paul McNett wrote:
>
>> dTimer isn't necessary, given that in all cases I can think of
>> dabo.ui.callAfterInterval() can be used in its place.
>
> For single calls, I would agree. But what about the use cases that need
> regular events? Maybe something like a digital clock display, or a process
> that refreshes every N seconds? I'm sure you could hack together some code to
> handle this, but isn't a timer a better abstraction?
Your case could handle it like:
{{{
class DigitalClock:
...
def afterInit(self):
self.displayCurrentTime()
def displayCurrentTime(self):
self.txtHour.Value = ...
...
dabo.ui.callAfterInterval(1000, self.displayCurrentTime)
}}}
...without the complication of managing the timer.
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]