diff options
author | fvogel <fvogelnew1@free.fr> | 2018-10-18 18:48:22 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2018-10-18 18:48:22 (GMT) |
commit | 4e54b1b43919621c5d881e4c61a9ee2b74467ced (patch) | |
tree | 6dc8e6a4aff3db5664a64553c797549df1c21ed1 /tests/scrollbar.test | |
parent | b18aa4ea942188a23aa3da751c433adc7ed060a6 (diff) | |
download | tk-4e54b1b43919621c5d881e4c61a9ee2b74467ced.zip tk-4e54b1b43919621c5d881e4c61a9ee2b74467ced.tar.gz tk-4e54b1b43919621c5d881e4c61a9ee2b74467ced.tar.bz2 |
Restore the remaining missing changes stripped out due to the recent merge/backout dance between branches (scrollbar fixes and Mojave fixes).
Diffstat (limited to 'tests/scrollbar.test')
-rw-r--r-- | tests/scrollbar.test | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/tests/scrollbar.test b/tests/scrollbar.test index af83e93..dcfc711 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -284,7 +284,7 @@ test scrollbar-3.41 {ScrollbarWidgetCmd procedure, "fraction" option} { if {[testConstraint testmetrics]} { place configure .t.s -width [expr 2*[testmetrics cxhscroll .t.s]+1] } else { - place configure .t.s -width [expr [winfo reqwidth .t.s] - 4] + place configure .t.s -width [expr [winfo height .t.s] - 2*([.t.s cget -highlightthickness] + [.t.s cget -bd] + 1)] } update test scrollbar-3.42 {ScrollbarWidgetCmd procedure, "fraction" option} { @@ -633,7 +633,7 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} { list [winfo children .] [interp hidden] } [list {} $l] -test scrollbar-10.1 {<MouseWheel> event on scrollbar} -constraints {win|unix} -setup { +test scrollbar-10.1.1 {<MouseWheel> event on scrollbar} -constraints {notAqua} -setup { destroy .t .s } -body { pack [text .t -yscrollcommand {.s set}] -side left @@ -647,8 +647,22 @@ test scrollbar-10.1 {<MouseWheel> event on scrollbar} -constraints {win|unix} -s } -cleanup { destroy .t .s } -result {5.0} +test scrollbar-10.1.2 {<MouseWheel> event on scrollbar} -constraints {aqua} -setup { + destroy .t .s +} -body { + pack [text .t -yscrollcommand {.s set}] -side left + for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} + pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left + update + focus -force .s + event generate .s <MouseWheel> -delta -4 + after 200 {set eventprocessed 1} ; vwait eventprocessed + .t index @0,0 +} -cleanup { + destroy .t .s +} -result {5.0} -test scrollbar-10.2 {<MouseWheel> event on scrollbar} -constraints {win|unix} -setup { +test scrollbar-10.2.1 {<MouseWheel> event on scrollbar} -constraints {notAqua} -setup { destroy .t .s } -body { pack [text .t -xscrollcommand {.s set} -wrap none] -side top @@ -662,6 +676,20 @@ test scrollbar-10.2 {<MouseWheel> event on scrollbar} -constraints {win|unix} -s } -cleanup { destroy .t .s } -result {1.4} +test scrollbar-10.2.2 {<MouseWheel> event on scrollbar} -constraints {aqua} -setup { + destroy .t .s +} -body { + pack [text .t -xscrollcommand {.s set} -wrap none] -side top + for {set i 1} {$i < 100} {incr i} {.t insert end "Char $i "} + pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top + update + focus -force .s + event generate .s <Shift-MouseWheel> -delta -4 + after 200 {set eventprocessed 1} ; vwait eventprocessed + .t index @0,0 +} -cleanup { + destroy .t .s +} -result {1.4} test scrollbar-11.1 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destruction} -body { proc destroy_scrollbar {} { |