Note that getting and setting field contents takes twice as long as
getting and setting a variable (setting takes 4 times as long if the
screen isn't locked due to the X calls and the redraws), so you could
optimize this by storing the time into a variable and comparing with
it first:
local curtime
on idle
if curtime is not the long time then
put the long time into curtime
put curtime into field "Time_Field"
end if
end idle
You could also set the idleRate to a bigger number, but neither of
these are really necessary. Most workstations are fast enough that
even doing something really CPU intensive like shell("date") will work
OK in an idle handler. This will slow down any weather forcasting you
happen to be doing in the background, however ;-)
If you want to get fancy, make an analog clock. You can use a polygon
style graphic for the hands, and set the points property in the idle
handler. Other than a little math (you'll need to use sin() and cos()
to get the length and orientation right) the process is
straightforward. You could either use another graphic for the clock
face, or cheat and take a snapshot of xclock and then erase the hands
and the background (use the bucket tool with mouse button 2). Sounds
like a good stack contest project to me (hint, hint).
Scott
-- *********************************************************************** * Scott Raney 303-447-3936 Remember: the better you look, * * raney@metacard.com the more you'll see -- Lidia * ***********************************************************************