diff options
author | Norbert Preining <norbert@preining.info> | 2024-03-15 03:06:35 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-03-15 03:06:35 +0000 |
commit | 12679ab7d3c2a210f4123163671b532b8b55d5f9 (patch) | |
tree | 0060d13467186ad977f4e73488ee20dd6c0017ab /systems/texlive/tlnet/tlpkg/tltcl/lib/tk8.6/scale.tcl | |
parent | 62170822e034fdd3f81de7274835d0d3b0467100 (diff) |
CTAN sync 202403150306
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tltcl/lib/tk8.6/scale.tcl')
-rw-r--r-- | systems/texlive/tlnet/tlpkg/tltcl/lib/tk8.6/scale.tcl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tltcl/lib/tk8.6/scale.tcl b/systems/texlive/tlnet/tlpkg/tltcl/lib/tk8.6/scale.tcl index fb9b81b26b..466a3ce6aa 100644 --- a/systems/texlive/tlnet/tlpkg/tltcl/lib/tk8.6/scale.tcl +++ b/systems/texlive/tlnet/tlpkg/tltcl/lib/tk8.6/scale.tcl @@ -210,7 +210,20 @@ proc ::tk::ScaleEndDrag {w} { proc ::tk::ScaleIncrement {w dir big repeat} { variable ::tk::Priv + if {![winfo exists $w]} return + + # give the cancel callback a chance to be serviced if the execution time of + # the -command script lasts longer than -repeatdelay + set clockms [clock milliseconds] + if {$repeat eq "again" && + [expr {$clockms - $Priv(clockms)}] > [expr {[$w cget -repeatinterval] * 1.1}]} { + set Priv(clockms) $clockms + set Priv(afterId) [after [$w cget -repeatinterval] \ + [list tk::ScaleIncrement $w $dir $big again]] + return + } + if {$big eq "big"} { set inc [$w cget -bigincrement] if {$inc == 0} { @@ -231,14 +244,18 @@ proc ::tk::ScaleIncrement {w dir big repeat} { set inc [expr {-$inc}] } } + # this will run the -command script (if any) during the redrawing + # of the scale at idle time $w set [expr {[$w get] + $inc}] if {$repeat eq "again"} { + set Priv(clockms) $clockms set Priv(afterId) [after [$w cget -repeatinterval] \ [list tk::ScaleIncrement $w $dir $big again]] } elseif {$repeat eq "initial"} { set delay [$w cget -repeatdelay] if {$delay > 0} { + set Priv(clockms) $clockms set Priv(afterId) [after $delay \ [list tk::ScaleIncrement $w $dir $big again]] } |