1Tk_InitStubs(3) Tk Library Procedures Tk_InitStubs(3)
2
3
4
5______________________________________________________________________________
6
8 Tk_InitStubs - initialize the Tk stubs mechanism
9
11 #include <tk.h>
12
13 const char *
14 Tk_InitStubs(interp, version, exact)
15
17 Tcl_Interp *interp (in) Tcl interpreter handle.
18
19 char *version (in) A version string consisting of one or
20 more decimal numbers separated by
21 dots.
22
23 int exact (in) Non-zero means that only the particu‐
24 lar Tk version specified by version is
25 acceptable. Zero means that versions
26 newer than version are also acceptable
27 as long as they have the same major
28 version number as version.
29_________________________________________________________________
30
32 The Tcl stubs mechanism defines a way to dynamically bind extensions to
33 a particular Tcl implementation at run time. the stubs mechanism
34 requires no changes to applications incoporating Tcl/Tk interpreters.
35 Only developers creating C-based Tcl/Tk extensions need to take steps
36 to use the stubs mechanism with their extensions. See the Tcl_Init‐
37 Stubs page for more information.
38
39 Enabling the stubs mechanism for a Tcl/Tk extension requires the fol‐
40 lowing steps:
41
42 1) Call Tcl_InitStubs in the extension before calling any other Tcl
43 functions.
44
45 2) Call Tk_InitStubs if the extension before calling any other Tk
46 functions.
47
48 2) Define the USE_TCL_STUBS symbol. Typically, you would include the
49 -DUSE_TCL_STUBS flag when compiling the extension.
50
51 3) Link the extension with the Tcl and Tk stubs libraries instead of
52 the standard Tcl and Tk libraries. On Unix platforms, the library
53 names are libtclstub8.4.a and libtkstub8.4.a; on Windows plat‐
54 forms, the library names are tclstub84.lib and tkstub84.lib
55 (adjust names with appropriate version number).
56
58 Tk_InitStubs attempts to initialize the Tk stub table pointers and
59 ensure that the correct version of Tk is loaded. In addition to an
60 interpreter handle, it accepts as arguments a version number and a
61 Boolean flag indicating whether the extension requires an exact version
62 match or not. If exact is 0, then the extension is indicating that
63 newer versions of Tk are acceptable as long as they have the same major
64 version number as version; non-zero means that only the specified ver‐
65 sion is acceptable. Tcl_InitStubs returns a string containing the
66 actual version of Tk satisfying the request, or NULL if the Tk version
67 is not acceptable, does not support the stubs mechanism, or any other
68 error condition occurred.
69
71 Tcl_InitStubs
72
74 stubs
75
76
77
78Tk 8.4 Tk_InitStubs(3)