Clock Display using After
- From: "ccdrbrg@xxxxxxxxx" <ccdrbrg@xxxxxxxxx>
- Date: 28 Sep 2006 07:07:13 -0700
I have written a simple ISO 8601 format clock display (source below).
I have noticed the time value will creep ahead of the system time by as
much as 30 seconds each day running. I do not understand why. I
believe [clock seconds] queries the system time and is evaluated each
time the after event is triggered. The fact that the displayed time
gets ahead of the system time is strange.
Any help would be much appreciated.
Chad
System:
Windows XP running tcl/tk 8.4.1 from cygwin.
Source:
variable date;
proc iso8601date { } {
global date;
set seconds [clock seconds];
set date [clock format ${seconds} -gmt 1 -format {%Y-%m-%dT%TZ}];
after 500 iso8601date;
};
iso8601date;
package require Tk;
wm protocol . WM_DELETE_WINDOW { exit };
wm title . "ISO8601 Date";
label .l -textvariable date -font {Arial 12 bold};
pack .l -padx 20;
wm resizable . 0 0;
bind .l <Double-Button-1> {
clipboard clear;
clipboard append [.l cget -text];
};
.
- Follow-Ups:
- Re: Clock Display using After
- From: Bruce Hartweg
- Re: Clock Display using After
- Prev by Date: how to install the tcl application as window service
- Next by Date: Re: How does xotcl compare to ruby?
- Previous by thread: how to install the tcl application as window service
- Next by thread: Re: Clock Display using After
- Index(es):