summaryrefslogtreecommitdiffstats
path: root/library/ttk
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-22 15:02:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-22 15:02:23 (GMT)
commit127c180c66bf291cae359b4c83fcfce3961af8be (patch)
tree75c30064dcd65da3c0b1a72f00f0985cee83c720 /library/ttk
parente1486d48b18bdd738d42c22f61f597b17ea02fc4 (diff)
downloadtk-127c180c66bf291cae359b4c83fcfce3961af8be.zip
tk-127c180c66bf291cae359b4c83fcfce3961af8be.tar.gz
tk-127c180c66bf291cae359b4c83fcfce3961af8be.tar.bz2
Allow using floating-point number in "scroll (x|y)view (units|pages)". They are rounded away from zero towards an integer.
Diffstat (limited to 'library/ttk')
-rw-r--r--library/ttk/utils.tcl12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl
index fc8b4e0..4827aa3 100644
--- a/library/ttk/utils.tcl
+++ b/library/ttk/utils.tcl
@@ -285,8 +285,8 @@ proc ttk::copyBindings {from to} {
#
proc ttk::bindMouseWheel {bindtag callback} {
- bind $bindtag <MouseWheel> [append callback { [expr {-(%D / 120)}]}]
- bind $bindtag <Option-MouseWheel> [append callback { [expr {-(%D / 12)}]}]
+ bind $bindtag <MouseWheel> [append callback { [expr {%D/-120.0}]}]
+ bind $bindtag <Option-MouseWheel> [append callback { [expr {%D/-12.0}]}]
}
## Mousewheel bindings for standard scrollable widgets.
@@ -298,12 +298,12 @@ proc ttk::bindMouseWheel {bindtag callback} {
#
bind TtkScrollable <MouseWheel> \
- { %W yview scroll [expr {-(%D / 120)}] units }
+ { %W yview scroll [expr {%D/-120}] units }
bind TtkScrollable <Option-MouseWheel> \
- { %W yview scroll [expr {-(%D / 12)}] units }
+ { %W yview scroll [expr {%D/-12}] units }
bind TtkScrollable <Shift-MouseWheel> \
- { %W xview scroll [expr {-(%D / 120)}] units }
+ { %W xview scroll [expr {%D/-120}] units }
bind TtkScrollable <Shift-Option-MouseWheel> \
- { %W xview scroll [expr {-(%D / 12)}] units }
+ { %W xview scroll [expr {%D/-12}] units }
#*EOF*