Tk Source Code

Check-in [b6f1c7d8]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix [2513186fff] and [f9343d8f72]: ttk::entry xview sub-command forces use of update idletasks. Thanks to cjmcdonald.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | bug-2513186fff | bug-8261c517af
Files: files | file ages | folders
SHA3-256: b6f1c7d8a5794a50d741792bc36fcc0af03b82977822ca4ee71aafa2990fc0a2
User & Date: fvogel 2019-04-22 22:09:50.812
References
2019-04-22
22:17 Ticket [2513186f] ttk::entry xview sub-command forces use of update idletasks status still Open with 4 other changes artifact: be15a740 user: fvogel
Context
2019-04-26
21:11
Optimize the fix: the layout calculation is only needed if the display is out of date. check-in: 5e1833a4 user: fvogel tags: bug-2513186fff, bug-8261c517af
2019-04-22
22:09
Fix [2513186fff] and [f9343d8f72]: ttk::entry xview sub-command forces use of update idletasks. Thanks to cjmcdonald. check-in: b6f1c7d8 user: fvogel tags: bug-2513186fff, bug-8261c517af
2019-04-20
15:03
On macOS, edit comments and documentation; fix compiler warnings. check-in: 476cf7ba user: culler tags: core-8-6-branch
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/ttk/ttkEntry.c.
1647
1648
1649
1650
1651
1652
1653







1654
1655
1656
1657
1658
1659
1660

/* $entry xview	-- horizontal scrolling interface
 */
static int EntryXViewCommand(
    void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
    Entry *entryPtr = recordPtr;







    if (objc == 3) {
	int newFirst;
	if (EntryIndex(interp, entryPtr, objv[2], &newFirst) != TCL_OK) {
	    return TCL_ERROR;
	}
	TtkScrollTo(entryPtr->entry.xscrollHandle, newFirst);
	return TCL_OK;







>
>
>
>
>
>
>







1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667

/* $entry xview	-- horizontal scrolling interface
 */
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) {
	    return TCL_ERROR;
	}
	TtkScrollTo(entryPtr->entry.xscrollHandle, newFirst);
	return TCL_OK;
Changes to library/ttk/entry.tcl.
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
    }
    return $pos
}

## 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]]} {
	$w xview $c
    }
}








<







207
208
209
210
211
212
213

214
215
216
217
218
219
220
    }
    return $pos
}

## See $index -- Make sure that the character at $index is visible.
#
proc ttk::entry::See {w {index insert}} {

    set c [$w index $index]
    # @@@ OR: check [$w index left] / [$w index right]
    if {$c < [$w index @0] || $c >= [$w index @[winfo width $w]]} {
	$w xview $c
    }
}