summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2000-04-14 08:33:31 (GMT)
committerhobbs <hobbs@noemail.net>2000-04-14 08:33:31 (GMT)
commitcbf0be65fb0a954607520756b5cfde6c3c3fe79f (patch)
tree0323615af7202c9cc1eba33c63ea62bbe14a71c7
parent30ffba9260e1d800dfa47b296e09afde7eea5c2a (diff)
downloadtk-cbf0be65fb0a954607520756b5cfde6c3c3fe79f.zip
tk-cbf0be65fb0a954607520756b5cfde6c3c3fe79f.tar.gz
tk-cbf0be65fb0a954607520756b5cfde6c3c3fe79f.tar.bz2
* library/scale.tcl (tkScaleActivate): reduced number of scale
redisplays by checking current value of state before setting it again. [Bug: 4191] FossilOrigin-Name: 89814bee4c9500f9610ff03aa36dd5eb3809f6d4
-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
}
}