summaryrefslogtreecommitdiffstats
path: root/library/scrlbar.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/scrlbar.tcl')
-rw-r--r--library/scrlbar.tcl34
1 files changed, 17 insertions, 17 deletions
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl
index e2b04b7..6073e74 100644
--- a/library/scrlbar.tcl
+++ b/library/scrlbar.tcl
@@ -20,7 +20,7 @@
if {($tcl_platform(platform) != "windows") &&
($tcl_platform(platform) != "macintosh")} {
bind Scrollbar <Enter> {
- if $tk_strictMotif {
+ if {$tk_strictMotif} {
set tkPriv(activeBg) [%W cget -activebackground]
%W config -activebackground [%W cget -background]
}
@@ -231,8 +231,8 @@ proc tkScrollStartDrag {w x y} {
if {$iv0 == 0} {
set tkPriv(initPos) 0.0
} else {
- set tkPriv(initPos) [expr (double([lindex $tkPriv(initValues) 2])) \
- / [lindex $tkPriv(initValues) 0]]
+ set tkPriv(initPos) [expr {(double([lindex $tkPriv(initValues) 2])) \
+ / [lindex $tkPriv(initValues) 0]}]
}
}
}
@@ -253,19 +253,19 @@ proc tkScrollDrag {w x y} {
if {$tkPriv(initPos) == ""} {
return
}
- set delta [$w delta [expr $x - $tkPriv(pressX)] [expr $y - $tkPriv(pressY)]]
- if [$w cget -jump] {
+ set delta [$w delta [expr {$x - $tkPriv(pressX)}] [expr {$y - $tkPriv(pressY)}]]
+ if {[$w cget -jump]} {
if {[llength $tkPriv(initValues)] == 2} {
- $w set [expr [lindex $tkPriv(initValues) 0] + $delta] \
- [expr [lindex $tkPriv(initValues) 1] + $delta]
+ $w set [expr {[lindex $tkPriv(initValues) 0] + $delta}] \
+ [expr {[lindex $tkPriv(initValues) 1] + $delta}]
} else {
- set delta [expr round($delta * [lindex $tkPriv(initValues) 0])]
+ set delta [expr {round($delta * [lindex $tkPriv(initValues) 0])}]
eval $w set [lreplace $tkPriv(initValues) 2 3 \
- [expr [lindex $tkPriv(initValues) 2] + $delta] \
- [expr [lindex $tkPriv(initValues) 3] + $delta]]
+ [expr {[lindex $tkPriv(initValues) 2] + $delta}] \
+ [expr {[lindex $tkPriv(initValues) 3] + $delta}]]
}
} else {
- tkScrollToPos $w [expr $tkPriv(initPos) + $delta]
+ tkScrollToPos $w [expr {$tkPriv(initPos) + $delta}]
}
}
@@ -283,10 +283,10 @@ proc tkScrollEndDrag {w x y} {
if {$tkPriv(initPos) == ""} {
return
}
- if [$w cget -jump] {
- set delta [$w delta [expr $x - $tkPriv(pressX)] \
- [expr $y - $tkPriv(pressY)]]
- tkScrollToPos $w [expr $tkPriv(initPos) + $delta]
+ if {[$w cget -jump]} {
+ set delta [$w delta [expr {$x - $tkPriv(pressX)}] \
+ [expr {$y - $tkPriv(pressY)}]]
+ tkScrollToPos $w [expr {$tkPriv(initPos) + $delta}]
}
set tkPriv(initPos) ""
}
@@ -375,9 +375,9 @@ proc tkScrollToPos {w pos} {
proc tkScrollTopBottom {w x y} {
global tkPriv
set element [$w identify $x $y]
- if [string match *1 $element] {
+ if {[string match *1 $element]} {
tkScrollToPos $w 0
- } elseif [string match *2 $element] {
+ } elseif {[string match *2 $element]} {
tkScrollToPos $w 1
}