Tk Source Code

Check-in [1df28451]
Login

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

Overview
Comment:[629b11ac] replace set by variable in namespace eval, as it may have critical side effects
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | core-8-branch
Files: files | file ages | folders
SHA3-256: 1df2845121f8fceb62f126bfc0eecd4a8267f4f8718560c3659d44e640f8e100
User & Date: oehhar 2024-08-05 13:21:20.023
Original Comment: [629b11ac] replace set by variable, as it may have critical side effects
References
2024-08-05
13:27 Closed ticket [629b11ac]: Migration tool warnings for Tk 9.0b3 plus 7 other changes artifact: 516eb822 user: oehhar
Context
2024-08-06
12:51
Make testcases more independant from exact error-message. Tweak some error-messages. check-in: 7a97cb3a user: jan.nijtmans tags: core-8-branch
2024-08-05
13:23
[629b11ac] replace set by variable in namespace eval. Not necessary for 9.0, but for source compatibility to 8.7 check-in: 505f9fd8 user: oehhar tags: trunk, main
13:21
[629b11ac] replace set by variable in namespace eval, as it may have critical side effects check-in: 1df28451 user: oehhar tags: core-8-branch
2024-08-04
21:16
TCLSCRIPTZIPNAME -> TCL_ZIP_FILE and TKSCRIPTZIPNAME -> TK_ZIP_FILE, for nmake makefile to be consistent with autoconf build check-in: 88e9ccaa user: jan.nijtmans tags: core-8-branch
Changes
Unified Diff Ignore Whitespace Patch
Changes to library/tkfbox.tcl.
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
namespace eval ::tk::dialog::file {
    namespace import -force ::tk::msgcat::*
    variable showHiddenBtn 0
    variable showHiddenVar 1

    # Based on Vimix/16/actions/go-up.svg
    # See https://github.com/vinceliuice/vimix-icon-theme
    set updirImageData {
	<?xml version="1.0" encoding="UTF-8"?>
	<svg width="16" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
	 <path d="m7 14v-9l-4 4-1-1 6-6 6 6-1 1-4-4v9z" fill="#000000"/>
	</svg>
    }

    proc UpdateUpdirImageData {} {
	variable updirImageData
	set idx1 [string first "#000000" $updirImageData]
	set idx2 [expr {$idx1 + 6}]

	set fgColor [ttk::style lookup . -foreground {} black]
	lassign [winfo rgb . $fgColor] r g b
	set fgColor [format "#%02x%02x%02x" \
		[expr {$r >> 8}] [expr {$g >> 8}] [expr {$b >> 8}]]

	return [string replace $updirImageData $idx1 $idx2 $fgColor]
    }

    # Based on https://icons8.com/icon/JXYalxb9XWWd/folder
    set folderImageData {
	<?xml version="1.0" encoding="UTF-8"?>
	<svg width="16" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
	 <path d="m0.5 13.5v-12h4.293l2 2h8.707v10z" fill="#59afff"/>
	 <path d="m4.586 2 2 2h8.414v9h-14v-11h3.586m0.414-1h-5v13h16v-11h-9l-2-2z" fill="#2d8cff"/>
	 <path d="m0.5 14.5v-10h4.618l2-1h8.382v11z" fill="#8cc5ff"/>
	 <path d="m15 4v10h-14v-9h4.236l0.211-0.106 1.789-0.894h7.764m1-1h-9l-2 1h-5v11h16z" fill="#2d8cff"/>
	</svg>
    }

    # Based on https://icons8.com/icon/mEF_vyjYlnE3/file
    set fileImageData {
	<?xml version="1.0" encoding="UTF-8"?>
	<svg width="16" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
	 <path d="m2 1h8l4 4v11h-12z" fill="#808080"/>
	 <path d="m3 2h6.5l3.5 3.5v9.5h-10z" fill="#f0f0f0"/>
	 <path d="m9 1v5h5v-1h-4v-4h-1z" fill="#808080"/>
	</svg>
    }







|




















|










|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
namespace eval ::tk::dialog::file {
    namespace import -force ::tk::msgcat::*
    variable showHiddenBtn 0
    variable showHiddenVar 1

    # Based on Vimix/16/actions/go-up.svg
    # See https://github.com/vinceliuice/vimix-icon-theme
    variable updirImageData {
	<?xml version="1.0" encoding="UTF-8"?>
	<svg width="16" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
	 <path d="m7 14v-9l-4 4-1-1 6-6 6 6-1 1-4-4v9z" fill="#000000"/>
	</svg>
    }

    proc UpdateUpdirImageData {} {
	variable updirImageData
	set idx1 [string first "#000000" $updirImageData]
	set idx2 [expr {$idx1 + 6}]

	set fgColor [ttk::style lookup . -foreground {} black]
	lassign [winfo rgb . $fgColor] r g b
	set fgColor [format "#%02x%02x%02x" \
		[expr {$r >> 8}] [expr {$g >> 8}] [expr {$b >> 8}]]

	return [string replace $updirImageData $idx1 $idx2 $fgColor]
    }

    # Based on https://icons8.com/icon/JXYalxb9XWWd/folder
    variable folderImageData {
	<?xml version="1.0" encoding="UTF-8"?>
	<svg width="16" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
	 <path d="m0.5 13.5v-12h4.293l2 2h8.707v10z" fill="#59afff"/>
	 <path d="m4.586 2 2 2h8.414v9h-14v-11h3.586m0.414-1h-5v13h16v-11h-9l-2-2z" fill="#2d8cff"/>
	 <path d="m0.5 14.5v-10h4.618l2-1h8.382v11z" fill="#8cc5ff"/>
	 <path d="m15 4v10h-14v-9h4.236l0.211-0.106 1.789-0.894h7.764m1-1h-9l-2 1h-5v11h16z" fill="#2d8cff"/>
	</svg>
    }

    # Based on https://icons8.com/icon/mEF_vyjYlnE3/file
    variable fileImageData {
	<?xml version="1.0" encoding="UTF-8"?>
	<svg width="16" height="16" version="1.1" xmlns="http://www.w3.org/2000/svg">
	 <path d="m2 1h8l4 4v11h-12z" fill="#808080"/>
	 <path d="m3 2h6.5l3.5 3.5v9.5h-10z" fill="#f0f0f0"/>
	 <path d="m9 1v5h5v-1h-4v-4h-1z" fill="#808080"/>
	</svg>
    }