summaryrefslogtreecommitdiffstats
path: root/library/text.tcl
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2023-11-20 21:45:27 (GMT)
committermarc_culler <marc.culler@gmail.com>2023-11-20 21:45:27 (GMT)
commitedaf075b9b0ff023177a8167a0ad159d56336fe3 (patch)
treee2be0091af9ee922e3168f54c6dd53ca83452289 /library/text.tcl
parent50ca6a3d2a0242016747053b1f08ce4c0ddaee3c (diff)
downloadtk-edaf075b9b0ff023177a8167a0ad159d56336fe3.zip
tk-edaf075b9b0ff023177a8167a0ad159d56336fe3.tar.gz
tk-edaf075b9b0ff023177a8167a0ad159d56336fe3.tar.bz2
Add smooth scrolling for Text widgets on macOS.
Diffstat (limited to 'library/text.tcl')
-rw-r--r--library/text.tcl9
1 files changed, 9 insertions, 0 deletions
diff --git a/library/text.tcl b/library/text.tcl
index eb73db0..c582fe3 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -456,6 +456,15 @@ bind Text <B2-Motion> {
}
set ::tk::Priv(prevPos) {}
+bind Text <Control-MouseWheel> {
+ lassign [tk::PreciseScrollDeltas %D] deltaX deltaY
+ if {$deltaX != 0} {
+ %W xview scroll $deltaX pixels
+ }
+ if {$deltaY != 0} {
+ %W yview scroll $deltaY pixels
+ }
+}
bind Text <MouseWheel> {
tk::MouseWheel %W y %D -4.0 pixels
}