From f43a38c216438267b70e6141ecb1b6fd5194fd9c Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 22 Apr 2019 22:09:50 +0000 Subject: Fix [2513186fff] and [f9343d8f72]: ttk::entry xview sub-command forces use of update idletasks. Thanks to cjmcdonald. --- generic/ttk/ttkEntry.c | 7 +++++++ library/ttk/entry.tcl | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index ebc485e..0f1707b 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1651,6 +1651,13 @@ static int EntryXViewCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Entry *entryPtr = recordPtr; + + /* + * Ensure that the scroll info is up-to-date before a scrolling command. + */ + + EntryDoLayout(recordPtr); + if (objc == 3) { int newFirst; if (EntryIndex(interp, entryPtr, objv[2], &newFirst) != TCL_OK) { diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl index c123bc9..e9f249c 100644 --- a/library/ttk/entry.tcl +++ b/library/ttk/entry.tcl @@ -211,7 +211,6 @@ proc ttk::entry::ClosestGap {w x} { ## See $index -- Make sure that the character at $index is visible. # proc ttk::entry::See {w {index insert}} { - update idletasks ;# ensure scroll data up-to-date set c [$w index $index] # @@@ OR: check [$w index left] / [$w index right] if {$c < [$w index @0] || $c >= [$w index @[winfo width $w]]} { -- cgit v0.12