diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-29 12:48:00 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-29 12:48:00 (GMT) |
commit | 9e83cbe850e17780f646217d932645e2105b605c (patch) | |
tree | 72db352c7424e32a55873cb29230927f4b09a7b2 /library/text.tcl | |
parent | 6162cfbddcf8e3a169053a09e42e89f5d7b56b28 (diff) | |
download | tk-9e83cbe850e17780f646217d932645e2105b605c.zip tk-9e83cbe850e17780f646217d932645e2105b605c.tar.gz tk-9e83cbe850e17780f646217d932645e2105b605c.tar.bz2 |
Add support for "(x|y)view scroll number mouseunits" for text widget, and use it in mouse bindings.
Diffstat (limited to 'library/text.tcl')
-rw-r--r-- | library/text.tcl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/text.tcl b/library/text.tcl index 72da6ff..98255e4 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -428,16 +428,16 @@ bind Text <B2-Motion> { set ::tk::Priv(prevPos) {} bind Text <MouseWheel> { - %W yview scroll [expr {-((%D+1)/3)}] pixels + %W yview scroll %D mouseunits } bind Text <Option-MouseWheel> { - %W yview scroll [expr {-4 * (%D)}] pixels + %W yview scroll [expr {10 * (%D)}] mouseunits } bind Text <Shift-MouseWheel> { - %W xview scroll [expr {-((%D+1)/3)}] pixels + %W xview scroll %D mouseunits } bind Text <Shift-Option-MouseWheel> { - %W xview scroll [expr {-4 * (%D)}] pixels + %W xview scroll [expr {10 * (%D)}] mouseunits } # ::tk::TextClosestGap -- |