diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-06-28 11:22:05 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-06-28 11:22:05 (GMT) |
commit | 0f4412a31c8058e493977c8d9a3a69f4f182bcd9 (patch) | |
tree | 47fe7ae5a9e1ed4466f072ec7a5697c6a23b0862 | |
parent | 37b2fe24513834256beb12e3366f0017f72eb0fc (diff) | |
parent | 9f8756599edd61712e8da85b0cfe627ea4cc502d (diff) | |
download | tk-0f4412a31c8058e493977c8d9a3a69f4f182bcd9.zip tk-0f4412a31c8058e493977c8d9a3a69f4f182bcd9.tar.gz tk-0f4412a31c8058e493977c8d9a3a69f4f182bcd9.tar.bz2 |
Bug [2501278]: ttk::scale keyboard binding problem
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | library/ttk/scale.tcl | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2012-06-28 Jan Nijtmans <nijtmans@users.sf.net> + + * library/ttk/scale.tcl: [Bug 2501278]: ttk::scale keyboard binding + problem. + 2013-06-05 Jan Nijtmans <nijtmans@users.sf.net> * generic/ttk/ttkScroll.c: [Bug 3613759]: ttk::entry and symbolic 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}] } |