summaryrefslogtreecommitdiffstats
path: root/library/ttk
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-06-28 11:22:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-06-28 11:22:05 (GMT)
commitd74eb7386bb1832fd1b3a687bc084fa2b9c9f9dc (patch)
tree47fe7ae5a9e1ed4466f072ec7a5697c6a23b0862 /library/ttk
parent72f15d7d0a6cbdb13d035d2466e7aa7114f7e552 (diff)
parentf9f1a2f876bb42a6df81c015fd172104c83ef5cc (diff)
downloadtk-d74eb7386bb1832fd1b3a687bc084fa2b9c9f9dc.zip
tk-d74eb7386bb1832fd1b3a687bc084fa2b9c9f9dc.tar.gz
tk-d74eb7386bb1832fd1b3a687bc084fa2b9c9f9dc.tar.bz2
Bug [2501278]: ttk::scale keyboard binding problem
Diffstat (limited to 'library/ttk')
-rw-r--r--library/ttk/scale.tcl5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/ttk/scale.tcl b/library/ttk/scale.tcl
index 69b9dd8..62c85bf 100644
--- a/library/ttk/scale.tcl
+++ b/library/ttk/scale.tcl
@@ -42,7 +42,7 @@ proc ttk::scale::Press {w x y} {
switch -glob -- [$w identify $x $y] {
*track -
*trough {
- set inc [expr {([$w get $x $y] <= [$w get]) ? -1 : 1}]
+ set inc [expr {([$w get $x $y] <= [$w get]) ^ ([$w cget -from] > [$w cget -to]) ? -1 : 1}]
ttk::Repeatedly Increment $w $inc
}
*slider {
@@ -87,5 +87,8 @@ proc ttk::scale::Release {w x y} {
proc ttk::scale::Increment {w delta} {
if {![winfo exists $w]} return
+ if {([$w cget -from] > [$w cget -to])} {
+ set delta [expr {-$delta}]
+ }
$w set [expr {[$w get] + $delta}]
}