Tk Source Code

Check-in [4c617794]
Login

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

Overview
Comment:merge trunk
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA3-256: 4c6177943243f9e63943624051bfa8e6c95edb0bdee80d2d1974cae1d29f2a98
User & Date: fvogel 2025-01-20 06:47:29
Context
2025-01-28
20:54
Merge 9.0. [5f739d2253] will be handled in separate commit check-in: d6343387 user: jan.nijtmans tags: revised_text, tip-466
2025-01-20
06:47
merge trunk check-in: 4c617794 user: fvogel tags: revised_text, tip-466
2025-01-19
20:46
Rename the fallback proc menubarheight to testmenubarheight. In [d5e602691a], in branch less_tests_constraints created off core-8-6-branch, I have renamed proc menubarheight to testmenubarheight to conform to how other such procs are named in the test suite. Later, in [e78b5c12b6] in trunk, I have added a fallback for that proc to be used by platforms other than macOS. And again later in [49fdd4b212] I have merged trunk in less_tests_constraints. This last commit created the inconsistency. check-in: d3948b1a user: fvogel tags: trunk, main
2025-01-08
20:21
merge trunk check-in: ce5f1dac user: fvogel tags: revised_text, tip-466
Changes
Unified Diff Ignore Whitespace Patch
Changes to .github/workflows/linux-build.yml.
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
          - "--disable-xss"
          - "--enable-symbols"
    steps:
      - name: Checkout Tk
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl 8.6
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: main
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |







|







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
          - "--disable-xss"
          - "--enable-symbols"
    steps:
      - name: Checkout Tk
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl 9.0
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: main
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
          - "--disable-xft"
          - "--enable-symbols"
    steps:
      - name: Checkout Tk
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: main
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |







|







136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
          - "--disable-xft"
          - "--enable-symbols"
    steps:
      - name: Checkout Tk
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl 9.0
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: main
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |
Changes to .github/workflows/linux-with-tcl8-build.yml.
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
          - "--disable-xss"
          - "--enable-symbols"
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: core-8-branch
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |







|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
          - "--disable-xss"
          - "--enable-symbols"
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl 8.7
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: core-8-branch
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
          - "--disable-xft"
          - "--enable-symbols"
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: core-8-branch
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |







|







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
          - "--disable-xft"
          - "--enable-symbols"
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl 8.7
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: core-8-branch
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |
Changes to .github/workflows/linux-with-tcl91-build.yml.
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
          - "--disable-xss"
          - "--enable-symbols"
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: tip-626
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |







|







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
          - "--disable-xss"
          - "--enable-symbols"
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl 9.1
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: tip-626
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
          - "--disable-xft"
          - "--enable-symbols"
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: tip-626
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |







|







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
          - "--disable-xft"
          - "--enable-symbols"
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          path: tk
      - name: Checkout Tcl 9.1
        uses: actions/checkout@v4
        with:
          repository: tcltk/tcl
          ref: tip-626
          path: tcl
      - name: Setup Environment (compiler=${{ matrix.compiler }})
        run: |
Changes to doc/wish.1.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.TH wish 1 8.0 Tk "Tk Applications"
.so man.macros
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
wish \- Simple windowing shell
.SH SYNOPSIS
\fBwish\fR ?\fB\-encoding \fIname\fR? ?\fIfileName arg ...\fR?
.SH OPTIONS
.\" OPTION: -encoding
.IP "\fB\-encoding \fIname\fR" 20
Specifies the encoding of the text stored in \fIfileName\fR.
This option is only recognized prior to the \fIfileName\fR argument.
.\" OPTION: -colormap
.IP "\fB\-colormap \fInew\fR" 20







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.TH wish 1 8.0 Tk "Tk Applications"
.so man.macros
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
wish \- Simple windowing shell
.SH SYNOPSIS
\fBwish\fR ?\fBoptions\fR? ?\fIfileName arg ...\fR?
.SH OPTIONS
.\" OPTION: -encoding
.IP "\fB\-encoding \fIname\fR" 20
Specifies the encoding of the text stored in \fIfileName\fR.
This option is only recognized prior to the \fIfileName\fR argument.
.\" OPTION: -colormap
.IP "\fB\-colormap \fInew\fR" 20
Changes to generic/tkWindow.c.
1019
1020
1021
1022
1023
1024
1025



1026
1027
1028
1029
1030
1031
1032
		".nmake"
#endif
#ifdef TK_NO_DEPRECATED
		".no-deprecate"
#endif
#ifndef TCL_CFG_OPTIMIZED
		".no-optimize"



#endif
#ifdef __OBJC__
		".objective-c"
#if defined(__cplusplus)
		"plusplus"
#endif
#endif







>
>
>







1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
		".nmake"
#endif
#ifdef TK_NO_DEPRECATED
		".no-deprecate"
#endif
#ifndef TCL_CFG_OPTIMIZED
		".no-optimize"
#endif
#if !defined(_WIN32) && !defined(MAC_OSX_TK) && !defined(HAVE_XFT)
		".no-xft"
#endif
#ifdef __OBJC__
		".objective-c"
#if defined(__cplusplus)
		"plusplus"
#endif
#endif
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
		".static"
#endif
#if defined(_WIN32)
		".win32"
#endif
#if !defined(_WIN32) && !defined(MAC_OSX_TK)
		".x11"
#if !defined(HAVE_XFT)
		".no-xft"
#endif
#endif
		;
#if TCL_MAJOR_VERSION > 8
	if (info.isNativeObjectProc == 2) {
	    Tcl_CreateObjCommand2(interp, "::tk::build-info",
		    info.objProc2, (void *)
		    version, NULL);







<
<
<







1044
1045
1046
1047
1048
1049
1050



1051
1052
1053
1054
1055
1056
1057
		".static"
#endif
#if defined(_WIN32)
		".win32"
#endif
#if !defined(_WIN32) && !defined(MAC_OSX_TK)
		".x11"



#endif
		;
#if TCL_MAJOR_VERSION > 8
	if (info.isNativeObjectProc == 2) {
	    Tcl_CreateObjCommand2(interp, "::tk::build-info",
		    info.objProc2, (void *)
		    version, NULL);
Changes to generic/ttk/ttkElements.c.
1441
1442
1443
1444
1445
1446
1447

1448
1449
1450
1451
1452
1453

1454
1455
1456
1457
1458
1459
1460
     */
    if (mainInfoPtr != NULL) {
	Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient);
	switch (orient) {
	    case TTK_ORIENT_HORIZONTAL:
		XFillRectangle(disp, d, gc,
			mainInfoPtr->troughInnerX, mainInfoPtr->troughInnerY,

			b.x + dim/2 - 1, mainInfoPtr->troughInnerHeight);
		break;
	    case TTK_ORIENT_VERTICAL:
		XFillRectangle(disp, d, gc,
			mainInfoPtr->troughInnerX, mainInfoPtr->troughInnerY,
			mainInfoPtr->troughInnerWidth, b.y + dim/2 - 1);

		break;
	}
    }

    /*
     * Construct the color strings innerColorStr,
     * outerColorStr, and borderColorStr







>
|




|
>







1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
     */
    if (mainInfoPtr != NULL) {
	Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient);
	switch (orient) {
	    case TTK_ORIENT_HORIZONTAL:
		XFillRectangle(disp, d, gc,
			mainInfoPtr->troughInnerX, mainInfoPtr->troughInnerY,
			b.x + dim/2 - mainInfoPtr->troughInnerX,
			mainInfoPtr->troughInnerHeight);
		break;
	    case TTK_ORIENT_VERTICAL:
		XFillRectangle(disp, d, gc,
			mainInfoPtr->troughInnerX, mainInfoPtr->troughInnerY,
			mainInfoPtr->troughInnerWidth,
			b.y + dim/2 - mainInfoPtr->troughInnerY);
		break;
	}
    }

    /*
     * Construct the color strings innerColorStr,
     * outerColorStr, and borderColorStr
Changes to tests/constraints.tcl.
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
	namespace export controlPointerWarpTiming

	# On macOS windows are not allowed to overlap the menubar at the top of the
	# screen or the dock.  So tests which move a window and then check whether it
	# got moved to the requested location should use a y coordinate larger than the
	# height of the menubar (normally 23 pixels) and an x coordinate larger than the
	# width of the dock, if it happens to be on the left.
	# menubarheight deals with this issue but may not be available from the test
	# environment, therefore provide a fallback here
	if {[llength [info procs menubarheight]] == 0} {
	    if {[tk windowingsystem] ne "aqua"} {
		# Windows may overlap the menubar
		proc menubarheight {} {
		    return 0
		}
	    } else {
		# Windows may not overlap the menubar
		proc menubarheight {} {
		    return 30 ;  # arbitrary value known to be larger than the menubar height
		}
	    }
	    namespace export menubarheight
	}
    }
}

namespace import -force tk::test::*

namespace import -force tcltest::testConstraint







|

|


|




|



|







242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
	namespace export controlPointerWarpTiming

	# On macOS windows are not allowed to overlap the menubar at the top of the
	# screen or the dock.  So tests which move a window and then check whether it
	# got moved to the requested location should use a y coordinate larger than the
	# height of the menubar (normally 23 pixels) and an x coordinate larger than the
	# width of the dock, if it happens to be on the left.
	# testmenubarheight deals with this issue but may not be available from the test
	# environment, therefore provide a fallback here
	if {[llength [info procs testmenubarheight]] == 0} {
	    if {[tk windowingsystem] ne "aqua"} {
		# Windows may overlap the menubar
		proc testmenubarheight {} {
		    return 0
		}
	    } else {
		# Windows may not overlap the menubar
		proc testmenubarheight {} {
		    return 30 ;  # arbitrary value known to be larger than the menubar height
		}
	    }
	    namespace export testmenubarheight
	}
    }
}

namespace import -force tk::test::*

namespace import -force tcltest::testConstraint
Changes to tests/font.test.
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
    }
} -result {LucidaBright}
test font-21.6 {Tk_PostscriptFontName procedure: spaces} -constraints {
    x11
} -body {
    set name {{new century schoolbook} 10}
    if {[font actual {{new century schoolbook} 10} -family] == "new century schoolbook"} {
        set x [psfontname "{new century schoolbook} 10"]
    } else {
        set x NewCenturySchlbk-Roman
    }
} -result {NewCenturySchlbk-Roman}
test font-21.7 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
    unix
} -body {
    set name {avantgarde 12 roman normal}
    if {[font actual {avantgarde 12 roman normal} -family] == "avantgarde"} {







|

|







934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
    }
} -result {LucidaBright}
test font-21.6 {Tk_PostscriptFontName procedure: spaces} -constraints {
    x11
} -body {
    set name {{new century schoolbook} 10}
    if {[font actual {{new century schoolbook} 10} -family] == "new century schoolbook"} {
	set x [psfontname "{new century schoolbook} 10"]
    } else {
	set x NewCenturySchlbk-Roman
    }
} -result {NewCenturySchlbk-Roman}
test font-21.7 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
    unix
} -body {
    set name {avantgarde 12 roman normal}
    if {[font actual {avantgarde 12 roman normal} -family] == "avantgarde"} {
Changes to tests/unixFont.test.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands

if {[tk windowingsystem] eq "x11"} {
    if {[testConstraint withXft]} {
        set fontsystemcmd [auto_execok fc-list]
    } else {
        set fontsystemcmd [auto_execok xlsfonts]
    }
}
foreach {constraint font} {
    hasArial      arial
    hasCourierNew "courier new"
    hasTimesNew   "times new roman"
} {







|

|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands

if {[tk windowingsystem] eq "x11"} {
    if {[testConstraint withXft]} {
	set fontsystemcmd [auto_execok fc-list]
    } else {
	set fontsystemcmd [auto_execok xlsfonts]
    }
}
foreach {constraint font} {
    hasArial      arial
    hasCourierNew "courier new"
    hasTimesNew   "times new roman"
} {
Changes to unix/Makefile.in.
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
	$(SHELL_ENV) valgrind $(VALGRINDARGS) ./$(TKTEST_EXE) $(SCRIPT)

INSTALL_BASE_TARGETS = install-binaries ${INSTALL_LIBRARIES}
INSTALL_DOC_TARGETS = install-doc
INSTALL_DEV_TARGETS = install-headers
INSTALL_DEMO_TARGETS = install-demos
INSTALL_EXTRA_TARGETS = @EXTRA_INSTALL@
INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_DEV_TARGETS) \
		$(INSTALL_DEMO_TARGETS) $(INSTALL_EXTRA_TARGETS)

install: $(INSTALL_TARGETS)

install-strip:
	$(MAKE) $(INSTALL_TARGETS) \
		INSTALL_PROGRAM="STRIPPROG='${INSTALL_STRIP_PROGRAM}' $(INSTALL_PROGRAM) -s" \
		INSTALL_LIBRARY="STRIPPROG='${INSTALL_STRIP_LIBRARY}' $(INSTALL_LIBRARY) -s"







|
|







772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
	$(SHELL_ENV) valgrind $(VALGRINDARGS) ./$(TKTEST_EXE) $(SCRIPT)

INSTALL_BASE_TARGETS = install-binaries ${INSTALL_LIBRARIES}
INSTALL_DOC_TARGETS = install-doc
INSTALL_DEV_TARGETS = install-headers
INSTALL_DEMO_TARGETS = install-demos
INSTALL_EXTRA_TARGETS = @EXTRA_INSTALL@
INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DEV_TARGETS) \
		$(INSTALL_DEMO_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_EXTRA_TARGETS)

install: $(INSTALL_TARGETS)

install-strip:
	$(MAKE) $(INSTALL_TARGETS) \
		INSTALL_PROGRAM="STRIPPROG='${INSTALL_STRIP_PROGRAM}' $(INSTALL_PROGRAM) -s" \
		INSTALL_LIBRARY="STRIPPROG='${INSTALL_STRIP_LIBRARY}' $(INSTALL_LIBRARY) -s"