Guido van Rossum | f713247 | 1994-06-27 08:00:16 +0000 | [diff] [blame] | 1 | /* appinit.c -- Tcl and Tk application initialization. */ |
| 2 | |
| 3 | #include <tcl.h> |
| 4 | #include <tk.h> |
| 5 | |
| 6 | int |
| 7 | Tcl_AppInit (interp) |
Barry Warsaw | 845a4c6 | 1997-01-14 17:36:36 +0000 | [diff] [blame] | 8 | Tcl_Interp *interp; |
Guido van Rossum | f713247 | 1994-06-27 08:00:16 +0000 | [diff] [blame] | 9 | { |
Barry Warsaw | 845a4c6 | 1997-01-14 17:36:36 +0000 | [diff] [blame] | 10 | Tk_Window main; |
Guido van Rossum | f713247 | 1994-06-27 08:00:16 +0000 | [diff] [blame] | 11 | |
Barry Warsaw | 845a4c6 | 1997-01-14 17:36:36 +0000 | [diff] [blame] | 12 | main = Tk_MainWindow(interp); |
Guido van Rossum | f713247 | 1994-06-27 08:00:16 +0000 | [diff] [blame] | 13 | |
Barry Warsaw | 845a4c6 | 1997-01-14 17:36:36 +0000 | [diff] [blame] | 14 | if (Tcl_Init (interp) == TCL_ERROR) |
| 15 | return TCL_ERROR; |
| 16 | if (Tk_Init (interp) == TCL_ERROR) |
| 17 | return TCL_ERROR; |
Guido van Rossum | f713247 | 1994-06-27 08:00:16 +0000 | [diff] [blame] | 18 | |
| 19 | #ifdef WITH_MOREBUTTONS |
Barry Warsaw | 845a4c6 | 1997-01-14 17:36:36 +0000 | [diff] [blame] | 20 | { |
| 21 | extern Tcl_CmdProc studButtonCmd; |
| 22 | extern Tcl_CmdProc triButtonCmd; |
Guido van Rossum | f713247 | 1994-06-27 08:00:16 +0000 | [diff] [blame] | 23 | |
Barry Warsaw | 845a4c6 | 1997-01-14 17:36:36 +0000 | [diff] [blame] | 24 | Tcl_CreateCommand(interp, "studbutton", studButtonCmd, |
| 25 | (ClientData) main, NULL); |
| 26 | Tcl_CreateCommand(interp, "tributton", triButtonCmd, |
| 27 | (ClientData) main, NULL); |
| 28 | } |
Guido van Rossum | f713247 | 1994-06-27 08:00:16 +0000 | [diff] [blame] | 29 | #endif |
| 30 | #ifdef WITH_XXX |
| 31 | |
| 32 | #endif |
Barry Warsaw | 845a4c6 | 1997-01-14 17:36:36 +0000 | [diff] [blame] | 33 | return TCL_OK; |
Guido van Rossum | f713247 | 1994-06-27 08:00:16 +0000 | [diff] [blame] | 34 | } |
| 35 | |