diff options
author | marc_culler <marc.culler@gmail.com> | 2023-11-27 19:35:43 (GMT) |
---|---|---|
committer | marc_culler <marc.culler@gmail.com> | 2023-11-27 19:35:43 (GMT) |
commit | 365c1aa8200f8ca770202b571eee7cc324531c77 (patch) | |
tree | 8e4be4165af680ad4580b4e2a3df0a18091304d3 /library/ttk | |
parent | 4cd583363c4980aacbd905f39eb33a7db39ae56b (diff) | |
download | tk-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.tcl | 9 |
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. |