summaryrefslogtreecommitdiff
path: root/tk/library/demos/cscroll.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tk/library/demos/cscroll.tcl')
-rw-r--r--tk/library/demos/cscroll.tcl15
1 files changed, 7 insertions, 8 deletions
diff --git a/tk/library/demos/cscroll.tcl b/tk/library/demos/cscroll.tcl
index 5897dcb26cd..aeabc181662 100644
--- a/tk/library/demos/cscroll.tcl
+++ b/tk/library/demos/cscroll.tcl
@@ -48,9 +48,9 @@ set bg [lindex [$c config -bg] 4]
for {set i 0} {$i < 20} {incr i} {
set x [expr {-10 + 3*$i}]
for {set j 0; set y -10} {$j < 10} {incr j; incr y 3} {
- $c create rect ${x}c ${y}c [expr $x+2]c [expr $y+2]c \
+ $c create rect ${x}c ${y}c [expr {$x+2}]c [expr {$y+2}]c \
-outline black -fill $bg -tags rect
- $c create text [expr $x+1]c [expr $y+1]c -text "$i,$j" \
+ $c create text [expr {$x+1}]c [expr {$y+1}]c -text "$i,$j" \
-anchor center -tags text
}
}
@@ -65,14 +65,14 @@ proc scrollEnter canvas {
global oldFill
set id [$canvas find withtag current]
if {[lsearch [$canvas gettags current] text] >= 0} {
- set id [expr $id-1]
+ set id [expr {$id-1}]
}
set oldFill [lindex [$canvas itemconfig $id -fill] 4]
if {[winfo depth $canvas] > 1} {
$canvas itemconfigure $id -fill SeaGreen1
} else {
$canvas itemconfigure $id -fill black
- $canvas itemconfigure [expr $id+1] -fill white
+ $canvas itemconfigure [expr {$id+1}] -fill white
}
}
@@ -80,18 +80,17 @@ proc scrollLeave canvas {
global oldFill
set id [$canvas find withtag current]
if {[lsearch [$canvas gettags current] text] >= 0} {
- set id [expr $id-1]
+ set id [expr {$id-1}]
}
$canvas itemconfigure $id -fill $oldFill
- $canvas itemconfigure [expr $id+1] -fill black
+ $canvas itemconfigure [expr {$id+1}] -fill black
}
proc scrollButton canvas {
global oldFill
set id [$canvas find withtag current]
if {[lsearch [$canvas gettags current] text] < 0} {
- set id [expr $id+1]
+ set id [expr {$id+1}]
}
puts stdout "You buttoned at [lindex [$canvas itemconf $id -text] 4]"
}
-