Fix an amazing number of typos & malformed sentences reported by Detlef
[python/dscho.git] / Modules / tkappinit.c
blob392269b18c297f409de3c414b8b420b8f382e77c
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").
15 #include <tcl.h>
16 #include <tk.h>
18 int
19 Tcl_AppInit(interp)
20 Tcl_Interp *interp;
22 Tk_Window main;
24 main = Tk_MainWindow(interp);
26 if (Tcl_Init (interp) == TCL_ERROR)
27 return TCL_ERROR;
28 if (Tk_Init (interp) == TCL_ERROR)
29 return 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);
41 #endif
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);*/
50 #endif
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);*/
58 #endif
60 #ifdef WITH_TIX
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);
66 #endif
68 #ifdef WITH_BLT
70 extern int Blt_Init(Tcl_Interp *);
71 extern int Blt_SafeInit(Tcl_Interp *);
72 Tcl_StaticPackage(NULL, "Blt", Blt_Init, Blt_SafeInit);
74 #endif
76 #ifdef WITH_TOGL
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);
83 #endif
85 #ifdef WITH_XXX
87 #endif
88 return TCL_OK;