From 242938d0a68c04c5687156c1a655a488bab01e76 Mon Sep 17 00:00:00 2001 From: hobbs Date: Sat, 30 Oct 1999 09:15:54 +0000 Subject: * 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). --- library/entry.tcl | 8 +++----- 1 file 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 } } -- cgit v0.12