Tk Source Code

Check-in [18c0eaf0]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

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

Overview
Comment:Better test for bug [2677890] since [19960bcef8] breaks relevance/efficiency of the previous version of textDisp-34.1
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-438
Files: files | file ages | folders
SHA1:18c0eaf0037b4eddb80108b953b688d2a408dffc
User & Date: fvogel 2015-11-16 17:21:36
Context
2015-11-19
20:46
First test-implementation of "$t yupdate -command <command>". TODO: more testcases and documentation check-in: 602f9502 user: jan.nijtmans tags: tip-438
2015-11-16
17:21
Better test for bug [2677890] since [19960bcef8] breaks relevance/efficiency of the previous version of textDisp-34.1 check-in: 18c0eaf0 user: fvogel tags: tip-438
13:54
Merge core-8-5-branch check-in: 5b73d5ef user: jan.nijtmans tags: tip-438
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/textDisp.test.

4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171

4172
4173
4174
4175
4176



4177
4178
4179
4180
4181
4182
4183
4184








4185
4186
4187

4188
4189
4190
4191
4192
4193
4194
	set result "italic font has much too much space"
    } else {
	set result "italic font measurement ok"
    }
} {italic font measurement ok}
destroy .tt

test textDisp-34.1 {Text widgets multi-scrolling problem: Bug 2677890} -setup {
    pack [text .t1 -width 10 -yscrollcommand {.sy set}] \
	[ttk::scrollbar .sy -orient vertical -command {.t1 yview}] \
	-side left -fill both
    bindtags .sy {}; # No clicky!
    set txt ""
    for {set i 0} {$i < 99} {incr i} {

	lappend txt "$i" [list pc $i] "\n" ""
    }
    set result {}
} -body {
    .t1 insert end {*}$txt



    update
    lappend result [.sy get]
    .t1 replace 6.0 6.0+1c "*"
    lappend result [.sy get]
    after 0 {lappend result [.sy get]}
    after 1000 {lappend result [.sy get]}
    vwait result;vwait result
    return $result








} -cleanup {
    destroy .t1 .sy
} -result {{0.0 0.24} {0.0 0.24} {0.0 0.24} {0.0 0.24}}


deleteWindows
option clear

# cleanup
cleanupTests
return







|
|
<
<
<

<
>
|



|
>
>
>

<
<
<
|
|
|
|
>
>
>
>
>
>
>
>

|
<
>







4158
4159
4160
4161
4162
4163
4164
4165
4166



4167

4168
4169
4170
4171
4172
4173
4174
4175
4176
4177



4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191

4192
4193
4194
4195
4196
4197
4198
4199
	set result "italic font has much too much space"
    } else {
	set result "italic font measurement ok"
    }
} {italic font measurement ok}
destroy .tt

test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup {
    pack [text .t1] -expand 1 -fill both



    set txt ""

    for {set i 1} {$i < 100} {incr i} {
        append txt "Line $i\n"
    }
    set result {}
} -body {
    .t1 insert end $txt
    .t1 debug 1
    set ge [winfo geometry .]
    scan $ge "%dx%d+%d+%d" width height left top
    update



    .t1 yupdate
    set negative 0
    bind .t1 <<TextLineHeightsInvalid>> { if {%d < 0} {set negative 1} }
    # Without the fix for bug 2677890, changing the width of the toplevel
    # will launch recomputation of the line heights, but will produce negative
    # number of still remaining outdated lines, which is obviously wrong.
    # Thus we use this way to check for regression regarding bug 2677890,
    # i.e. to check that the fix for this bug really is still in.
    wm geometry . "[expr {$width * 2}]x$height+$left+$top"
    update
    .t1 yupdate
    set negative
} -cleanup {
    destroy .t1

} -result {0}

deleteWindows
option clear

# cleanup
cleanupTests
return