summaryrefslogtreecommitdiffstats
path: root/library/scrlbar.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-01-25 18:21:40 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-01-25 18:21:40 (GMT)
commitee09dd0c7cfc65378fac95dd53067bcd72b390e9 (patch)
tree9b964605296b4f7dd7bd91a2baa6ebd8c0bf21bc /library/scrlbar.tcl
parent2a147ca9e8cdff6b06499b16942dd0a9b8b92228 (diff)
downloadtk-ee09dd0c7cfc65378fac95dd53067bcd72b390e9.zip
tk-ee09dd0c7cfc65378fac95dd53067bcd72b390e9.tar.gz
tk-ee09dd0c7cfc65378fac95dd53067bcd72b390e9.tar.bz2
* library/bgerror.tcl: Updates to use Tcl 8.4 features. [Patch 1237759] * library/button.tcl:
* library/choosedir.tcl: * library/clrpick.tcl: * library/comdlg.tcl: * library/console.tcl: * library/dialog.tcl: * library/entry.tcl: * library/focus.tcl: * library/listbox.tcl: * library/menu.tcl: * library/msgbox.tcl: * library/palette.tcl: * library/panedwindow.tcl: * library/safetk.tcl: * library/scale.tcl: * library/scrlbar.tcl: * library/spinbox.tcl: * library/tearoff.tcl: * library/text.tcl: * library/tk.tcl: * library/tkfbox.tcl: * library/xmfbox.tcl:
Diffstat (limited to 'library/scrlbar.tcl')
-rw-r--r--library/scrlbar.tcl27
1 files changed, 12 insertions, 15 deletions
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl
index 49cd1b6..516fb38 100644
--- a/library/scrlbar.tcl
+++ b/library/scrlbar.tcl
@@ -3,7 +3,7 @@
# This file defines the default bindings for Tk scrollbar widgets.
# It also provides procedures that help in implementing the bindings.
#
-# RCS: @(#) $Id: scrlbar.tcl,v 1.10.2.1 2004/02/17 07:17:17 das Exp $
+# RCS: @(#) $Id: scrlbar.tcl,v 1.10.2.2 2006/01/25 18:21:41 dgp Exp $
#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -17,7 +17,7 @@
#-------------------------------------------------------------------------
# Standard Motif bindings:
-if {[string equal [tk windowingsystem] "x11"]} {
+if {[tk windowingsystem] eq "x11"} {
bind Scrollbar <Enter> {
if {$tk_strictMotif} {
@@ -130,8 +130,7 @@ bind Scrollbar <End> {
tk::ScrollToPos %W 1
}
}
-if {[string equal [tk windowingsystem] "classic"]
- || [string equal [tk windowingsystem] "aqua"]} {
+if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Scrollbar <MouseWheel> {
tk::ScrollByUnits %W v [expr {- (%D)}]
}
@@ -159,7 +158,7 @@ proc tk::ScrollButtonDown {w x y} {
set Priv(relief) [$w cget -activerelief]
$w configure -activerelief sunken
set element [$w identify $x $y]
- if {[string equal $element "slider"]} {
+ if {$element eq "slider"} {
ScrollStartDrag $w $x $y
} else {
ScrollSelect $w $element initial
@@ -210,10 +209,10 @@ proc ::tk::ScrollSelect {w element repeat} {
"arrow2" {ScrollByUnits $w hv 1}
default {return}
}
- if {[string equal $repeat "again"]} {
+ if {$repeat eq "again"} {
set Priv(afterId) [after [$w cget -repeatinterval] \
[list tk::ScrollSelect $w $element again]]
- } elseif {[string equal $repeat "initial"]} {
+ } elseif {$repeat eq "initial"} {
set delay [$w cget -repeatdelay]
if {$delay > 0} {
set Priv(afterId) [after $delay \
@@ -233,7 +232,7 @@ proc ::tk::ScrollSelect {w element repeat} {
proc ::tk::ScrollStartDrag {w x y} {
variable ::tk::Priv
- if {[string equal [$w cget -command] ""]} {
+ if {[$w cget -command] eq ""} {
return
}
set Priv(pressX) $x
@@ -263,7 +262,7 @@ proc ::tk::ScrollStartDrag {w x y} {
proc ::tk::ScrollDrag {w x y} {
variable ::tk::Priv
- if {[string equal $Priv(initPos) ""]} {
+ if {$Priv(initPos) eq ""} {
return
}
set delta [$w delta [expr {$x - $Priv(pressX)}] [expr {$y - $Priv(pressY)}]]
@@ -293,7 +292,7 @@ proc ::tk::ScrollDrag {w x y} {
proc ::tk::ScrollEndDrag {w x y} {
variable ::tk::Priv
- if {[string equal $Priv(initPos) ""]} {
+ if {$Priv(initPos) eq ""} {
return
}
if {[$w cget -jump]} {
@@ -317,8 +316,7 @@ proc ::tk::ScrollEndDrag {w x y} {
proc ::tk::ScrollByUnits {w orient amount} {
set cmd [$w cget -command]
- if {[string equal $cmd ""] || ([string first \
- [string index [$w cget -orient] 0] $orient] < 0)} {
+ if {$cmd eq "" || ([string first [string index [$w cget -orient] 0] $orient] < 0)} {
return
}
set info [$w get]
@@ -342,8 +340,7 @@ proc ::tk::ScrollByUnits {w orient amount} {
proc ::tk::ScrollByPages {w orient amount} {
set cmd [$w cget -command]
- if {[string equal $cmd ""] || ([string first \
- [string index [$w cget -orient] 0] $orient] < 0)} {
+ if {$cmd eq "" || ([string first [string index [$w cget -orient] 0] $orient] < 0)} {
return
}
set info [$w get]
@@ -366,7 +363,7 @@ proc ::tk::ScrollByPages {w orient amount} {
proc ::tk::ScrollToPos {w pos} {
set cmd [$w cget -command]
- if {[string equal $cmd ""]} {
+ if {$cmd eq ""} {
return
}
set info [$w get]