Tk Library Source Code

Check-in [bf07168387]
Login

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

Overview
Comment:Tsw: Guarded against a bug in the ttk::scale widget's "get x y" command.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bf0716838785d2c8bd7eeeae9a18da9af130d1bb04ddea66547fbd88fe02ae43
User & Date: csaba 2025-07-07 19:43:02.081
Context
2025-07-16
11:16
Tsw: Added/updated a few comments in toggleswitch.tcl. check-in: 9282d3aaae user: csaba tags: trunk
2025-07-09
16:47
Create new branch named "textForSvg" check-in: c9fd94449e user: kjnash tags: textForSvg
2025-07-07
19:43
Tsw: Guarded against a bug in the ttk::scale widget's "get x y" command. check-in: bf07168387 user: csaba tags: trunk
19:39
Tablelist: Minor improvements related to the editing with the aid of the toggleswitch widget. check-in: 456e4f440f user: csaba tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to modules/tsw/CHANGES.txt.
10
11
12
13
14
15
16


17
18
19
20
21
22
23
   touchscreen as input device.

3. Improved the support for older macOS versions.

4. Worked around the fact that for some third-party themes, the
   retrieval of the root style's foreground color returns an empty
   string.



What was new in Tsw 1.1?
------------------------

1. For compatibility with the (ttk::)checkbutton, toggling the widget's
   switch state by changing the value of the variable specified by the
   "-variable" option will no longer cause the script specified by the







>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
   touchscreen as input device.

3. Improved the support for older macOS versions.

4. Worked around the fact that for some third-party themes, the
   retrieval of the root style's foreground color returns an empty
   string.

5. Guarded against a bug in the ttk::scale widget's "get x y" command.

What was new in Tsw 1.1?
------------------------

1. For compatibility with the (ttk::)checkbutton, toggling the widget's
   switch state by changing the value of the variable specified by the
   "-variable" option will no longer cause the script specified by the
Changes to modules/tsw/scripts/toggleswitch.tcl.
732
733
734
735
736
737
738







739
740
741

742
743
744
745
746
747
748
	if {!$stateArr(dragging) && abs($x - $stateArr(startX)) > $scaled4} {
	    set stateArr(dragging) 1
	}
	if {!$stateArr(dragging)} {
	    return ""
	}








	lassign [$w coords] curX curY
	set newX [expr {$curX + $x - $stateArr(prevX)}]
	$w set [$w get $newX $curY]


	set stateArr(prevX) $x
    }
}

#------------------------------------------------------------------------------
# tsw::onButtonRel1







>
>
>
>
>
>
>
|
|
|
>







732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
	if {!$stateArr(dragging) && abs($x - $stateArr(startX)) > $scaled4} {
	    set stateArr(dragging) 1
	}
	if {!$stateArr(dragging)} {
	    return ""
	}

	#
	# Guard against a bug in the ttk::scale widget's
	# "get x y" command (open as of July 2025)
	#
	lassign [$w coords [$w cget -from]] fromX fromY
	lassign [$w coords [$w cget -to]] toX toY
	if {$fromX < $toX} {
	    lassign [$w coords] curX curY
	    set newX [expr {$curX + $x - $stateArr(prevX)}]
	    $w set [$w get $newX $curY]
	}

	set stateArr(prevX) $x
    }
}

#------------------------------------------------------------------------------
# tsw::onButtonRel1