summaryrefslogtreecommitdiffstats
path: root/tests/scrollbar.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-01-09 22:30:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-01-09 22:30:01 (GMT)
commit1495c801841af36629d7d985074d43ddc31f62fe (patch)
treeffbc1ac410beb03eb9a7066e0be4aadd748bbf53 /tests/scrollbar.test
parente07b10f1a79f05875a092a57edd405f0e23f7345 (diff)
downloadtk-1495c801841af36629d7d985074d43ddc31f62fe.zip
tk-1495c801841af36629d7d985074d43ddc31f62fe.tar.gz
tk-1495c801841af36629d7d985074d43ddc31f62fe.tar.bz2
(cherry-pick) Fix [1927212]: MouseWheel unbound for non-aqua scrollbars. Thanks to Francois Vogel for the actual work
Diffstat (limited to 'tests/scrollbar.test')
-rw-r--r--tests/scrollbar.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/scrollbar.test b/tests/scrollbar.test
index 5d4334f..35f48bd 100644
--- a/tests/scrollbar.test
+++ b/tests/scrollbar.test
@@ -632,6 +632,36 @@ 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 {
+ 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 -120
+ 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 {
+ 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 -120
+ after 200 {set eventprocessed 1} ; vwait eventprocessed
+ .t index @0,0
+} -cleanup {
+ destroy .t .s
+} -result {1.4}
+
catch {destroy .s}
catch {destroy .t}