summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>1999-10-30 09:15:54 (GMT)
committerhobbs <hobbs>1999-10-30 09:15:54 (GMT)
commit242938d0a68c04c5687156c1a655a488bab01e76 (patch)
tree898e72dc0618fd210c256594ac3b6c381436d844
parentc40e64cffc6d43f82b8a410d192034f17863826a (diff)
downloadtk-242938d0a68c04c5687156c1a655a488bab01e76.zip
tk-242938d0a68c04c5687156c1a655a488bab01e76.tar.gz
tk-242938d0a68c04c5687156c1a655a488bab01e76.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).
-rw-r--r--library/entry.tcl8
1 files changed, 3 insertions, 5 deletions
diff --git a/library/entry.tcl b/library/entry.tcl
index 72c9ce6..75f448c 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.8 1999/09/02 17:02:52 hobbs Exp $
+# RCS: @(#) $Id: entry.tcl,v 1.9 1999/10/30 09:15:54 hobbs Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -514,10 +514,8 @@ proc tkEntrySeeInsert w {
$w xview $c
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
}
}