blob: 1239da5ee4ff99b0fa1a19b573935e583b25734a [file] [log] [blame]
Guido van Rossumf7132471994-06-27 08:00:16 +00001/* appinit.c -- Tcl and Tk application initialization. */
2
3#include <tcl.h>
4#include <tk.h>
5
6int
7Tcl_AppInit (interp)
Barry Warsaw845a4c61997-01-14 17:36:36 +00008 Tcl_Interp *interp;
Guido van Rossumf7132471994-06-27 08:00:16 +00009{
Barry Warsaw845a4c61997-01-14 17:36:36 +000010 Tk_Window main;
Guido van Rossumf7132471994-06-27 08:00:16 +000011
Barry Warsaw845a4c61997-01-14 17:36:36 +000012 main = Tk_MainWindow(interp);
Guido van Rossumf7132471994-06-27 08:00:16 +000013
Barry Warsaw845a4c61997-01-14 17:36:36 +000014 if (Tcl_Init (interp) == TCL_ERROR)
15 return TCL_ERROR;
16 if (Tk_Init (interp) == TCL_ERROR)
17 return TCL_ERROR;
Guido van Rossumf7132471994-06-27 08:00:16 +000018
19#ifdef WITH_MOREBUTTONS
Barry Warsaw845a4c61997-01-14 17:36:36 +000020 {
21 extern Tcl_CmdProc studButtonCmd;
22 extern Tcl_CmdProc triButtonCmd;
Guido van Rossumf7132471994-06-27 08:00:16 +000023
Barry Warsaw845a4c61997-01-14 17:36:36 +000024 Tcl_CreateCommand(interp, "studbutton", studButtonCmd,
25 (ClientData) main, NULL);
26 Tcl_CreateCommand(interp, "tributton", triButtonCmd,
27 (ClientData) main, NULL);
28 }
Guido van Rossumf7132471994-06-27 08:00:16 +000029#endif
Guido van Rossum1cbdfb91997-05-14 19:22:11 +000030
31#ifdef WITH_PIL /* 0.2b5 and later -- not yet released as of May 14 */
32 {
33 extern void TkImaging_Init(Tcl_Interp *interp);
34 TkImaging_Init(interp);
35 }
36#endif
37
38#ifdef WITH_PIL_OLD /* 0.2b4 and earlier */
39 {
40 extern void TkImaging_Init(void);
41 TkImaging_Init();
42 }
43#endif
44
Guido van Rossumf7132471994-06-27 08:00:16 +000045#ifdef WITH_XXX
46
47#endif
Barry Warsaw845a4c61997-01-14 17:36:36 +000048 return TCL_OK;
Guido van Rossumf7132471994-06-27 08:00:16 +000049}