Tk Source Code

Check-in [57f9af77]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Bug [2501278]: ttk::scale keyboard binding problem
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 57f9af7736bfaa207bf39c4ea79bff6869628d6f
User & Date: jan.nijtmans 2013-06-28 11:22:05
References
2013-06-28
11:22 Pending ticket [2501278f]: ttk::scale keyboard binding problem + patch plus 8 other changes artifact: 96b6171c user: jan.nijtmans
Context
2013-06-28
13:16
merge-mark check-in: 5606b8b7 user: jan.nijtmans tags: trunk
11:22
Bug [2501278]: ttk::scale keyboard binding problem check-in: 57f9af77 user: jan.nijtmans tags: trunk
11:17
Bug [2501278]: ttk::scale keyboard binding problem check-in: 3fec32a9 user: jan.nijtmans tags: core-8-5-branch
2013-06-27
19:02
manually revert changes caused by different autoconf versions check-in: fea7f4b3 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.






1
2
3
4
5
6
7





2013-06-05  Jan Nijtmans  <[email protected]>

	* generic/ttk/ttkScroll.c: [Bug 3613759]: ttk::entry and symbolic
	index names.
	* generic/ttk/ttkEntry.c: [Bug 2100430]: ttk::entry widget index
	must be integer
	* generic/tkEntry.c: Don't set interp result when it will be
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2012-06-28  Jan Nijtmans  <[email protected]>

	* library/ttk/scale.tcl: [Bug 2501278]: ttk::scale keyboard binding
	problem.

2013-06-05  Jan Nijtmans  <[email protected]>

	* generic/ttk/ttkScroll.c: [Bug 3613759]: ttk::entry and symbolic
	index names.
	* generic/ttk/ttkEntry.c: [Bug 2100430]: ttk::entry widget index
	must be integer
	* generic/tkEntry.c: Don't set interp result when it will be

Changes to library/ttk/scale.tcl.

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
proc ttk::scale::Press {w x y} {
    variable State
    set State(dragging) 0

    switch -glob -- [$w identify $x $y] {
	*track -
        *trough {
            set inc [expr {([$w get $x $y] <= [$w get]) ? -1 : 1}]
            ttk::Repeatedly Increment $w $inc
        }
        *slider {
            set State(dragging) 1
            set State(initial) [$w get]
        }
    }







|







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
proc ttk::scale::Press {w x y} {
    variable State
    set State(dragging) 0

    switch -glob -- [$w identify $x $y] {
	*track -
        *trough {
            set inc [expr {([$w get $x $y] <= [$w get]) ^ ([$w cget -from] > [$w cget -to]) ? -1 : 1}]
            ttk::Repeatedly Increment $w $inc
        }
        *slider {
            set State(dragging) 1
            set State(initial) [$w get]
        }
    }
83
84
85
86
87
88
89



90
91
    variable State
    set State(dragging) 0
    ttk::CancelRepeat
}

proc ttk::scale::Increment {w delta} {
    if {![winfo exists $w]} return



    $w set [expr {[$w get] + $delta}]
}







>
>
>


83
84
85
86
87
88
89
90
91
92
93
94
    variable State
    set State(dragging) 0
    ttk::CancelRepeat
}

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}]
}