summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-06-28 11:17:14 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-06-28 11:17:14 (GMT)
commit9f8756599edd61712e8da85b0cfe627ea4cc502d (patch)
treedf73f45e23a41814b98ddc25fce584c3e93e4bdf
parent629ad2a93f4774731ad0753a48caebb4aabca5ab (diff)
downloadtk-9f8756599edd61712e8da85b0cfe627ea4cc502d.zip
tk-9f8756599edd61712e8da85b0cfe627ea4cc502d.tar.gz
tk-9f8756599edd61712e8da85b0cfe627ea4cc502d.tar.bz2
Bug [2501278]: ttk::scale keyboard binding problem
-rw-r--r--ChangeLog5
-rw-r--r--library/ttk/scale.tcl5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d3b46a7..ef332bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-28 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * library/ttk/scale.tcl: [Bug 2501278]: ttk::scale keyboard binding
+ problem.
+
2012-06-07 Jan Nijtmans <nijtmans@users.sf.net>
* win/tkWinDialog.c: [Bug 1913750]: tk_chooseDirectory -initialdir
diff --git a/library/ttk/scale.tcl b/library/ttk/scale.tcl
index 23d08ed..4a534de 100644
--- a/library/ttk/scale.tcl
+++ b/library/ttk/scale.tcl
@@ -39,7 +39,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 {
@@ -84,5 +84,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}]
}