[Xotcl] small example: clock.xotcl

Gustaf Neumann neumann at wu-wien.ac.at
Fri Mar 23 20:23:19 CET 2001


Dear community,
here is a really small example of XOTcl + Tk: a small digital
clock that runs under unix and Win.

best regards
-gustaf
===============================================================================	
#!/usr/local/bin/xowish
Class Clock -parameter top
Clock instproc init {} {
  [self] instvar W
  set W [label [[self] set top].[self]]
  pack $W
  [self] tick
}
Clock instproc tick {} {
  [[self] set W] conf -text [clock format [clock seconds] -format %H:%M:%S]
  after 1000 [self] tick
}

Clock c -top .




More information about the Xotcl mailing list