View · Search · Index
No registered users in community xowiki
in last 10 minutes

[Xotcl] small example: clock.xotcl

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Fri, 23 Mar 2001 20:23:19 +0100

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 .