#!/bin/sh  
# \
exec oagwish "$0" "$@"

# $Log: not supported by cvs2svn $
# Revision 1.6  2003/09/08 20:49:41  soliday
# Updated for WIN32
#
# Revision 1.5  1999/02/16 19:14:40  soliday
# Changed [exec uname -n] to [info hostname]
#
# Revision 1.4  1999/01/07 21:42:58  borland
# Use internal clock format instead of UNIX date command.
#
# Revision 1.3  1999/01/06 20:26:19  borland
# Added -timeOnly option.
#
# Revision 1.2  1999/01/04 15:46:42  borland
# Added -brief option for a smaller window.
#
# Revision 1.1  1997/05/06 20:54:28  borland
# First version.
#

set auto_path [linsert $auto_path 0  /usr/local/oag/apps/lib/$env(HOST_ARCH)]
set auto_path [linsert $auto_path 0 /usr/local/oag/lib_patch/$env(HOST_ARCH)]
set apsttk 1
##APSDebugPath

set CVSRevisionAuthor "\$Revision: 1.7 $ \$Author: soliday $"

set brief 0
set timeOnly 0
set args $argv
APSStrictParseArguments {brief timeOnly}

set width 22
if $timeOnly {
    set width 8
}

if $brief {
    APSStandardSetup
    wm title . wishClock
    frame .userFrame -width 200 -height 100
    pack .userFrame -side top -fill both -expand 1
    APSLabeledOutput .time -parent .userFrame \
            -label "" \
            -textVariable theTime -width $width
} else {
    APSApplication . -name wishClock -version $CVSRevisionAuthor 
    APSLabeledOutput .time -parent .userFrame \
            -label "Time on [info hostname]: " \
            -textVariable theTime -width $width
}

proc UpdateClockOutput {} {
    global theTime timeOnly
    if !$timeOnly {
        set theTime [clock format [clock seconds] -format "%a %b %e %H:%M:%S"]
    } else {
        set theTime [clock format [clock seconds] -format %T]
    }
    update
    after 500 UpdateClockOutput
}

UpdateClockOutput

