1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#ScoreBar.tcl
#Note that there is only one global score_curvar variable, so some of
#this object-stuff is overkill...
class ScoreBar
ScoreBar inherit TrnModule
#Option is not used yet, but things stop working with no options
ArtTree option -enabled {1}
ScoreBar method init { args } {
instvar f
eval $self conf_verify $args
set f [next]
$self setup
}
#Consider adding the label back in if we are *not* a toplevel
ScoreBar method setup {} {
instvar f
global score_curvar
$self configure -title "Current Score"
scale $f.s \
-length 10c -orient horizontal -from -50 -to 50 -tickinterval 10 \
-variable score_curvar
set score_curvar 0
pack $f.s
}
|