Tk Source Code

View Ticket
Login
2026-10-04
17:04
Fix [22d2341c9d]: Building extensions for Tk 8 and Tcl 8 in a Tcl 9 environment check-in: 9c5a5ddf user: jan.nijtmans tags: core-9-0-branch
17:01 • Ticket [22d2341c] Building extensions for Tk 8 and Tcl 8 in a Tcl 9 environment status still Closed with 4 other changes artifact: 83c5b7cf user: jan.nijtmans
16:58 • Closed ticket [22d2341c]. artifact: 70402c20 user: jan.nijtmans
10:52 • Ticket [22d2341c]: 3 changes artifact: 2657a553 user: serhiy.storchaka
10:51
Fix [22d2341c9d]: Building extensions for Tk 8 and Tcl 8 in a Tcl 9 environment. Since the fix for Tcl ticket ad08bca6b1 (Tcl 9.0.4), tcl.h undefines Tcl_Size at its end in Tcl 8 mode, but tk.h uses it; define it in tk.h too, as tclOODecls.h does. closed check-in: 1f0f2475 user: serhiy.storchaka tags: tk8-mode-tcl-size
2024-11-14
22:36
Make Tk_CanvasTextInfo and tkScrollbar.h usable for Tk 8.x-compiles too. See [22d2341c9d] check-in: 055d75f6 user: jan.nijtmans tags: trunk, main
2024-11-13
20:23 • Pending ticket [22d2341c]: Building extensions for Tk 8 and Tcl 8 in a Tcl 9 environment plus 4 other changes artifact: 3af7b221 user: jan.nijtmans
14:33
Fix [22d2341c9d]: Building extensions for Tk 8 and Tcl 8 in a Tcl 9 environment. Add a configure "--with-tk8" option check-in: e7540187 user: jan.nijtmans tags: trunk, main
14:32
Fix [22d2341c9d]: Building extensions for Tk 8 and Tcl 8 in a Tcl 9 environment. Add a configure "--with-tk8" option check-in: fa41fdc0 user: jan.nijtmans tags: core-8-branch
2024-11-12
15:37 • Ticket [22d2341c] Building extensions for Tk 8 and Tcl 8 in a Tcl 9 environment status still Open with 3 other changes artifact: 7d096f03 user: jan.nijtmans
15:37 • New ticket [22d2341c]. artifact: 6c895f7e user: jan.nijtmans

Ticket UUID: 22d2341c9d48aa2eac08227bae0e647c7f5909bb
Title: Building extensions for Tk 8 and Tcl 8 in a Tcl 9 environment
Type: Bug Version: 9.0
Submitter: jan.nijtmans Created on: 2024-11-12 15:37:03
Subsystem: (unused) Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2026-10-04 17:01:48
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-10-04 17:01:48
Description:
TIP #628 didn't take into account that some extensions link with both Tcl and Tk. There is no --with-tk8 option, corresponding with the --with-tcl8 option for Tcl.

Maybe there are more problems than that. @max, if you have more information, you can add that to this ticket.
User Comments: jan.nijtmans added on 2026-10-04 17:01:48:

Hm, I was a little bit too quick. Something which is supported with Tk 9.0 is used its headers to compile actually with Tcl 8.6/Tk 8.6. In this situation, the tk8-mode-tcl-size makes sense.

Thanks!


jan.nijtmans added on 2026-10-04 16:58:55:

For Tk, "building with Tcl 8" actually meant "building with Tcl 8.7". Reason: Tk 9.0 uses Tcl_GetIntForIndex(), Tcl_CreateObjCommand2(), Tcl_DStringToObj() and Tcl_UtfToChar16DString(). Tk 9.0 was never meant to work with Tcl 8.6.

Also, Tk 9.0 can only be compiled with TCL_UTF_MAX=4, in order to be able to use unicode codepoints > 0xFFFF. Tcl 8.6 doesn't support that at all. Tcl 8.7 does, but will never be released (now that Tcl 9.0 is taking over rapidly).

Therefore, branch tk8-mode-tcl-size doesn't make much sense. Even with this change, it's far from being able to actually run with Tcl 8.6.


serhiy.storchaka added on 2026-10-04 10:52:45:

Since the fix for Tcl ad08bca6b1 (Tcl 9.0.4), tk.h of Tk 9.0 no longer compiles in Tcl 8 mode: tcl.h undefines Tcl_Size at its end, but tk.h and tkDecls.h use it. Proposed fix in branch tk8-mode-tcl-size: tk.h defines and undefines Tcl_Size as tclOODecls.h does. With it, the structures have the same sizes as in Tk 8.6. Tk 9.1 headers do not support Tcl 8 mode, so this is only for 9.0.


jan.nijtmans added on 2024-11-13 20:23:29:

I succeeded to build the Tkimg extension for Tcl 8.x/Tk 8.x, but using Tcl 9.0/Tk 9.0 headers. What I needed was this change in TEA, a new --with-tk8 option. And a few modifications in Tkimg.

Any more missing?