File: ScoreBar.tcl

package info (click to toggle)
trn4 4.0-test77-18
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, trixie
  • size: 4,016 kB
  • sloc: ansic: 48,332; sh: 6,795; tcl: 1,696; yacc: 662; perl: 108; makefile: 26
file content (31 lines) | stat: -rw-r--r-- 692 bytes parent folder | download | duplicates (12)
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
}