Tk Source Code

Artifact [2775ca08]
Login

Artifact 2775ca08f78b27ab627a0f87d75094fe29cd07a6d42746a06e9005dad3550d93:

Wiki page [Migrating C extensions to Tk 9] by oehhar 2025-01-30 13:13:01.
D 2025-01-30T13:13:01.780
L Migrating\sC\sextensions\sto\sTk\s9
N text/x-markdown
P 4b5266c2332c526fe47c3f5dead4fbf6dae0399a1e756b521f7cfe14a42efae9
U oehhar
W 1129
(Work in progress...)

## Init stubs and package require with open version

The list of versions should include Tk 9. Here is an example for Tk 8.5 up to any Tk 9 version.
Note that the upper bound "10" is exclusive.

~~~
    if (Tk_InitStubs(interp, "8.5-10", 0) == NULL) {
        return TCL_ERROR;
    }
~~~

The Tk_InitStubs command changed in the following aspects:

   *   The strict parameter changed in type from boolean to a bit field. Only values of 0 and 1 are supported.
   *   If the preprocessor variable "USE_TK_STUBS" is not defined, a direct link to the Tk library is assumed. In this case, no stubs table is initialized. The given version specification is verified against the calling interpreter.

## Tk_ConfigureWidget argc/argv interface removed

*Tk_ConfigureWidget* has two interfaces, and argc/argv and and TCL object interface.
The argc/argv interface is removed.

Code which uses the TCL object interface (which has the *TK_CONFIG_OBJS* option in the flags parameter) does not need any change.

See [TIP 647](https://core.tcl-lang.org/tips/doc/trunk/tip/647.md) for details.


Z b89b1ca714c276906f76f424d1ba244d