summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorhobbs <hobbs>1999-10-30 09:36:08 (GMT)
committerhobbs <hobbs>1999-10-30 09:36:08 (GMT)
commite2381acdd7056b37a46cd92429e0e6a61d96c638 (patch)
tree029273797c1ecdebe046f28229234dad9623244a /library
parenta53b3a74deb81d5c52b4c8ffc4e003377c96911a (diff)
downloadtk-e2381acdd7056b37a46cd92429e0e6a61d96c638.zip
tk-e2381acdd7056b37a46cd92429e0e6a61d96c638.tar.gz
tk-e2381acdd7056b37a46cd92429e0e6a61d96c638.tar.bz2
* library/entry.tcl: change tkEntrySeeInsert to avoid the use
of a while loop that could eat CPU tremendously. Behavior of moving the cursor at the right edge changes slightly (previously it tried to keep the cursor at the right edge, now it moves the cursor to a "central right" location - better IMHO). [Bug: 3195] * library/scrlbar.tcl: changed tkScrollButtonUp to check for existence of tkPriv(relief) in order to avoid spurious release events
Diffstat (limited to 'library')
-rw-r--r--library/entry.tcl7
-rw-r--r--library/scrlbar.tcl11
2 files changed, 10 insertions, 8 deletions
diff --git a/library/entry.tcl b/library/entry.tcl
index 2bb27c2..fae80d6 100644
--- a/library/entry.tcl
+++ b/library/entry.tcl
@@ -3,7 +3,7 @@
# This file defines the default bindings for Tk entry widgets and provides
# procedures that help in implementing those bindings.
#
-# RCS: @(#) $Id: entry.tcl,v 1.7 1999/08/09 16:52:06 hobbs Exp $
+# RCS: @(#) $Id: entry.tcl,v 1.7.4.1 1999/10/30 09:36:08 hobbs Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -515,9 +515,8 @@ proc tkEntrySeeInsert w {
return
}
set x [winfo width $w]
- while {([$w index @$x] <= $c) && ($left < $c)} {
- incr left
- $w xview $left
+ if {$c > [$w index @[winfo width $w]]} {
+ $w xview insert
}
}
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl
index 93d4a3c..f3ff9f2 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.5 1999/04/16 01:51:27 stanton Exp $
+# RCS: @(#) $Id: scrlbar.tcl,v 1.5.6.1 1999/10/30 09:36:09 hobbs Exp $
#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -163,9 +163,12 @@ proc tkScrollButtonDown {w x y} {
proc tkScrollButtonUp {w x y} {
global tkPriv
tkCancelRepeat
- $w configure -activerelief $tkPriv(relief)
- tkScrollEndDrag $w $x $y
- $w activate [$w identify $x $y]
+ if {[info exists tkPriv(relief)]} {
+ # Avoid error due to spurious release events
+ $w configure -activerelief $tkPriv(relief)
+ tkScrollEndDrag $w $x $y
+ $w activate [$w identify $x $y]
+ }
}
# tkScrollSelect --