Tcl8.6.7/Tk8.6.7 Documentation > Tk C API, version 8.6.7 > TkInitStubs
Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API
- Tk_InitStubs — initialize the Tk stubs mechanism
- #include <tk.h>
- const char *
- Tk_InitStubs(interp, version, exact)
- const char *
- SEE ALSO
const char *
Tk_InitStubs(interp, version, exact)
- Tcl_Interp *interp (in)
- Tcl interpreter handle.
- char *version (in)
- A version string consisting of one or more decimal numbers separated by dots.
- int exact (in)
- Non-zero means that only the particular Tk version specified by version is acceptable. Zero means that versions newer than version are also acceptable as long as they have the same major version number as version.
Enabling the stubs mechanism for a Tcl/Tk extension requires the following steps:
- Call Tcl_InitStubs in the extension before calling any other Tcl functions.
- Call Tk_InitStubs if the extension before calling any other Tk functions.
- Define the USE_TCL_STUBS and the USE_TK_STUBS symbols. Typically, you would include the -DUSE_TCL_STUBS and the -DUSE_TK_STUBS flags when compiling the extension.
- Link the extension with the Tcl and Tk stubs libraries instead of the standard Tcl and Tk libraries. On Unix platforms, the library names are libtclstub8.4.a and libtkstub8.4.a; on Windows platforms, the library names are tclstub84.lib and tkstub84.lib. Adjust the library names with appropriate version number but note that the extension may only be used with versions of Tcl/Tk that have that version number or higher.
Copyright © 1999 Scriptics Corporation