summaryrefslogtreecommitdiffstats
path: root/library/ttk
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2023-11-27 19:35:43 (GMT)
committermarc_culler <marc.culler@gmail.com>2023-11-27 19:35:43 (GMT)
commit365c1aa8200f8ca770202b571eee7cc324531c77 (patch)
tree8e4be4165af680ad4580b4e2a3df0a18091304d3 /library/ttk
parent4cd583363c4980aacbd905f39eb33a7db39ae56b (diff)
downloadtk-365c1aa8200f8ca770202b571eee7cc324531c77.zip
tk-365c1aa8200f8ca770202b571eee7cc324531c77.tar.gz
tk-365c1aa8200f8ca770202b571eee7cc324531c77.tar.bz2
Adapt Csaba's ttk::combobox and ttk::spinbox bindings to this setup.
Diffstat (limited to 'library/ttk')
-rw-r--r--library/ttk/spinbox.tcl9
1 files changed, 9 insertions, 0 deletions
diff --git a/library/ttk/spinbox.tcl b/library/ttk/spinbox.tcl
index 9f002cd..252521a 100644
--- a/library/ttk/spinbox.tcl
+++ b/library/ttk/spinbox.tcl
@@ -24,6 +24,15 @@ bind TSpinbox <<Increment>> { ttk::spinbox::Spin %W +1 }
bind TSpinbox <<Decrement>> { ttk::spinbox::Spin %W -1 }
ttk::bindMouseWheel TSpinbox [list ttk::spinbox::Spin %W]
+bind TSpinbox <Shift-MouseWheel> {
+ # Ignore the event
+}
+bind TSpinbox <TouchpadScroll> {
+ lassign [tk::PreciseScrollDeltas %D] deltaX deltaY
+ if {$deltaY != 0 && [expr {%# %% 12}] == 0} {
+ ttk::spinbox::Spin %W [expr {$deltaY > 0 ? -1 : 1}]
+ }
+}
## Motion --
# Sets cursor.