summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-04-14 08:33:31 (GMT)
committerhobbs <hobbs>2000-04-14 08:33:31 (GMT)
commit6138d7d06a94b0adacec8014d978d5273e1909de (patch)
tree0323615af7202c9cc1eba33c63ea62bbe14a71c7
parentfef56976bf80f019323ba08dffe50ca4852ab2b3 (diff)
downloadtk-6138d7d06a94b0adacec8014d978d5273e1909de.zip
tk-6138d7d06a94b0adacec8014d978d5273e1909de.tar.gz
tk-6138d7d06a94b0adacec8014d978d5273e1909de.tar.bz2
* library/scale.tcl (tkScaleActivate): reduced number of scale
redisplays by checking current value of state before setting it again. [Bug: 4191]
-rw-r--r--library/scale.tcl10
1 files changed, 6 insertions, 4 deletions
diff --git a/library/scale.tcl b/library/scale.tcl
index 4e71ac8..da24e15 100644
--- a/library/scale.tcl
+++ b/library/scale.tcl
@@ -3,7 +3,7 @@
# This file defines the default bindings for Tk scale widgets and provides
# procedures that help in implementing the bindings.
#
-# RCS: @(#) $Id: scale.tcl,v 1.6 2000/01/06 02:22:24 hobbs Exp $
+# RCS: @(#) $Id: scale.tcl,v 1.7 2000/04/14 08:33:31 hobbs Exp $
#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1995 Sun Microsystems, Inc.
@@ -106,14 +106,16 @@ bind Scale <End> {
# x, y - Mouse coordinates.
proc tkScaleActivate {w x y} {
- global tkPriv
if {[string equal [$w cget -state] "disabled"]} {
return
}
if {[string equal [$w identify $x $y] "slider"]} {
- $w configure -state active
+ set state active
} else {
- $w configure -state normal
+ set state normal
+ }
+ if {[string compare [$w cget -state] $state]} {
+ $w configure -state $state
}
}