1 /* appinit.c -- Tcl and Tk application initialization.
3 The function Tcl_AppInit() below initializes various Tcl packages.
4 It is called for each Tcl interpreter created by _tkinter.create().
5 It needs to be compiled with -DWITH_<package> flags for each package
6 that you are statically linking with. You may have to add sections
7 for packages not yet listed below.
9 Note that those packages for which Tcl_StaticPackage() is called with
10 a NULL first argument are known as "static loadable" packages to
11 Tcl but not actually initialized. To use these, you have to load
12 it explicitly, e.g. tkapp.eval("load {} Blt").
24 main
= Tk_MainWindow(interp
);
26 if (Tcl_Init (interp
) == TCL_ERROR
)
28 if (Tk_Init (interp
) == TCL_ERROR
)
31 #ifdef WITH_MOREBUTTONS
33 extern Tcl_CmdProc studButtonCmd
;
34 extern Tcl_CmdProc triButtonCmd
;
36 Tcl_CreateCommand(interp
, "studbutton", studButtonCmd
,
37 (ClientData
) main
, NULL
);
38 Tcl_CreateCommand(interp
, "tributton", triButtonCmd
,
39 (ClientData
) main
, NULL
);
43 #ifdef WITH_PIL /* 0.2b5 and later -- not yet released as of May 14 */
45 extern void TkImaging_Init(Tcl_Interp
*);
46 TkImaging_Init(interp
);
47 /* XXX TkImaging_Init() doesn't have the right return type */
48 /*Tcl_StaticPackage(interp, "Imaging", TkImaging_Init, NULL);*/
52 #ifdef WITH_PIL_OLD /* 0.2b4 and earlier */
54 extern void TkImaging_Init(void);
55 /* XXX TkImaging_Init() doesn't have the right prototype */
56 /*Tcl_StaticPackage(interp, "Imaging", TkImaging_Init, NULL);*/
62 extern int Tix_Init(Tcl_Interp
*interp
);
63 extern int Tix_SafeInit(Tcl_Interp
*interp
);
64 Tcl_StaticPackage(NULL
, "Tix", Tix_Init
, Tix_SafeInit
);
70 extern int Blt_Init(Tcl_Interp
*);
71 extern int Blt_SafeInit(Tcl_Interp
*);
72 Tcl_StaticPackage(NULL
, "Blt", Blt_Init
, Blt_SafeInit
);
78 /* XXX I've heard rumors that this doesn't work */
79 extern int Togl_Init(Tcl_Interp
*);
80 /* XXX Is there no Togl_SafeInit? */
81 Tcl_StaticPackage(NULL
, "Togl", Togl_Init
, NULL
);