From 52aa91a44c447c1641518dfb622155c09761c6bc Mon Sep 17 00:00:00 2001 From: csaba Date: Wed, 17 Jul 2024 10:47:49 +0000 Subject: Fix for bug [d1a5067111], related to the TouchpadScroll event bindings. --- library/listbox.tcl | 10 +++++----- library/scrlbar.tcl | 10 +++++----- library/text.tcl | 10 +++++----- library/ttk/combobox.tcl | 6 +++--- library/ttk/spinbox.tcl | 6 +++--- library/ttk/utils.tcl | 10 +++++----- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/library/listbox.tcl b/library/listbox.tcl index e229caf..1f93673 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -191,12 +191,12 @@ bind Listbox { if {%# %% 5 != 0} { return } - lassign [tk::PreciseScrollDeltas %D] tk::Priv::deltaX tk::Priv::deltaY - if {$tk::Priv::deltaX != 0} { - %W xview scroll [expr {-$tk::Priv::deltaX}] units + lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) + if {$tk::Priv(deltaX) != 0} { + %W xview scroll [expr {-$tk::Priv(deltaX)}] units } - if {$tk::Priv::deltaY != 0} { - %W yview scroll [expr {-$tk::Priv::deltaY}] units + if {$tk::Priv(deltaY) != 0} { + %W yview scroll [expr {-$tk::Priv(deltaY)}] units } } diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index fd44f10..29d892f 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -145,12 +145,12 @@ bind Scrollbar { tk::ScrollByUnits %W hv %D -12.0 } bind Scrollbar { - lassign [tk::PreciseScrollDeltas %D] tk::Priv::deltaX tk::Priv::deltaY - if {$tk::Priv::deltaX != 0 && [%W cget -orient] eq "horizontal"} { - tk::ScrollbarScrollByPixels %W h $tk::Priv::deltaX + lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) + if {$tk::Priv(deltaX) != 0 && [%W cget -orient] eq "horizontal"} { + tk::ScrollbarScrollByPixels %W h $tk::Priv(deltaX) } - if {$tk::Priv::deltaY != 0 && [%W cget -orient] eq "vertical"} { - tk::ScrollbarScrollByPixels %W v $tk::Priv::deltaY + if {$tk::Priv(deltaY) != 0 && [%W cget -orient] eq "vertical"} { + tk::ScrollbarScrollByPixels %W v $tk::Priv(deltaY) } } diff --git a/library/text.tcl b/library/text.tcl index 5003ade..37aa387 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -469,12 +469,12 @@ bind Text { tk::MouseWheel %W x [tk::ScaleNum %D] -1.2 pixels } bind Text { - lassign [tk::PreciseScrollDeltas %D] tk::Priv::deltaX tk::Priv::deltaY - if {$tk::Priv::deltaX != 0} { - %W xview scroll [tk::ScaleNum [expr {-$tk::Priv::deltaX}]] pixels + lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) + if {$tk::Priv(deltaX) != 0} { + %W xview scroll [tk::ScaleNum [expr {-$tk::Priv(deltaX)}]] pixels } - if {$tk::Priv::deltaY != 0} { - %W yview scroll [tk::ScaleNum [expr {-$tk::Priv::deltaY}]] pixels + if {$tk::Priv(deltaY) != 0} { + %W yview scroll [tk::ScaleNum [expr {-$tk::Priv(deltaY)}]] pixels } } diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl index 649cbd0..d593eb1 100644 --- a/library/ttk/combobox.tcl +++ b/library/ttk/combobox.tcl @@ -57,10 +57,10 @@ bind TCombobox { # Ignore the event } bind TCombobox { - lassign [tk::PreciseScrollDeltas %D] tk::Priv::deltaX tk::Priv::deltaY + lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) # TouchpadScroll events fire about 60 times per second. - if {$tk::Priv::deltaY != 0 && %# %% 15 == 0} { - ttk::combobox::Scroll %W [expr {$tk::Priv::deltaY > 0 ? -1 : 1}] + if {$tk::Priv(deltaY) != 0 && %# %% 15 == 0} { + ttk::combobox::Scroll %W [expr {$tk::Priv(deltaY) > 0 ? -1 : 1}] } } bind TCombobox <> { ttk::combobox::TraverseIn %W } diff --git a/library/ttk/spinbox.tcl b/library/ttk/spinbox.tcl index c865795..56629bb 100644 --- a/library/ttk/spinbox.tcl +++ b/library/ttk/spinbox.tcl @@ -28,10 +28,10 @@ bind TSpinbox { # Ignore the event } bind TSpinbox { - lassign [tk::PreciseScrollDeltas %D] tk::Priv::deltaX tk::Priv::deltaY + lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) # TouchpadScroll events fire about 60 times per second. - if {$tk::Priv::deltaY != 0 && %# %% 12 == 0} { - ttk::spinbox::Spin %W [expr {$tk::Priv::deltaY > 0 ? -1 : 1}] + if {$tk::Priv(deltaY) != 0 && %# %% 12 == 0} { + ttk::spinbox::Spin %W [expr {$tk::Priv(deltaY) > 0 ? -1 : 1}] } } diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl index 4b49ae0..ea0082f 100644 --- a/library/ttk/utils.tcl +++ b/library/ttk/utils.tcl @@ -307,12 +307,12 @@ bind TtkScrollable { if {%# %% 5 != 0} { return } - lassign [tk::PreciseScrollDeltas %D] tk::Priv::deltaX tk::Priv::deltaY - if {$tk::Priv::deltaX != 0} { - %W xview scroll [expr {-$tk::Priv::deltaX}] units + lassign [tk::PreciseScrollDeltas %D] tk::Priv(deltaX) tk::Priv(deltaY) + if {$tk::Priv(deltaX) != 0} { + %W xview scroll [expr {-$tk::Priv(deltaX)}] units } - if {$tk::Priv::deltaY != 0} { - %W yview scroll [expr {-$tk::Priv::deltaY}] units + if {$tk::Priv(deltaY) != 0} { + %W yview scroll [expr {-$tk::Priv(deltaY)}] units } } #*EOF* -- cgit v0.12