diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-01-08 22:10:59 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-01-08 22:10:59 (GMT) |
commit | a74bdffd9369f2ed76ba90a5497e5a4f7b2475cd (patch) | |
tree | c6cb6b751f75c8a59e80f6d2d81e8a980cd0f293 | |
parent | 3b7649bdc1d6357c2c3145879d0720493e784622 (diff) | |
download | tk-a74bdffd9369f2ed76ba90a5497e5a4f7b2475cd.zip tk-a74bdffd9369f2ed76ba90a5497e5a4f7b2475cd.tar.gz tk-a74bdffd9369f2ed76ba90a5497e5a4f7b2475cd.tar.bz2 |
Make test-case and binding equal for win32 and x11. Test-case doesn't pass yet
-rw-r--r-- | library/scrlbar.tcl | 4 | ||||
-rw-r--r-- | tests/scrollbar.test | 17 |
2 files changed, 18 insertions, 3 deletions
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index b1658ac..b7be014 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -153,10 +153,10 @@ switch [tk windowingsystem] { } "x11" { bind Scrollbar <MouseWheel> { - tk::ScrollByUnits %W v [expr {- (%D /120 )}] + tk::ScrollByUnits %W v [expr {- (%D /120 ) * 4}] } bind Scrollbar <Shift-MouseWheel> { - tk::ScrollByUnits %W h [expr {- (%D /120 )}] + tk::ScrollByUnits %W h [expr {- (%D /120 ) * 4}] } bind Scrollbar <4> {tk::ScrollByUnits %W v -5} bind Scrollbar <5> {tk::ScrollByUnits %W v 5} diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 8f92c93..6717deb 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -632,7 +632,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 -setup { +test scrollbar-10.1 {<MouseWheel> event on scrollbar} -setup { destroy .t .s } -body { pack [text .t -yscrollcommand {.s set}] -side left @@ -647,6 +647,21 @@ test scrollbar-10.1 {<MouseWheel> event on scrollbar} -constraints win -setup { destroy .t .s } -result {2.0} +test scrollbar-10.2 {<MouseWheel> event on scrollbar} -setup { + destroy .t .s +} -body { + pack [text .t -xscrollcommand {.s set}] -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 {2.0} + catch {destroy .s} catch {destroy .t} |