1994-06-27 05:00:16 -03:00
|
|
|
/* appinit.c -- Tcl and Tk application initialization. */
|
|
|
|
|
|
|
|
#include <tcl.h>
|
|
|
|
#include <tk.h>
|
|
|
|
|
1997-11-19 14:56:17 -04:00
|
|
|
#ifdef WITH_BLT
|
|
|
|
#include "blt.h"
|
|
|
|
#endif
|
|
|
|
|
1994-06-27 05:00:16 -03:00
|
|
|
int
|
|
|
|
Tcl_AppInit (interp)
|
1997-01-14 13:36:36 -04:00
|
|
|
Tcl_Interp *interp;
|
1994-06-27 05:00:16 -03:00
|
|
|
{
|
1997-01-14 13:36:36 -04:00
|
|
|
Tk_Window main;
|
1994-06-27 05:00:16 -03:00
|
|
|
|
1997-01-14 13:36:36 -04:00
|
|
|
main = Tk_MainWindow(interp);
|
1994-06-27 05:00:16 -03:00
|
|
|
|
1997-01-14 13:36:36 -04:00
|
|
|
if (Tcl_Init (interp) == TCL_ERROR)
|
|
|
|
return TCL_ERROR;
|
|
|
|
if (Tk_Init (interp) == TCL_ERROR)
|
|
|
|
return TCL_ERROR;
|
1994-06-27 05:00:16 -03:00
|
|
|
|
|
|
|
#ifdef WITH_MOREBUTTONS
|
1997-01-14 13:36:36 -04:00
|
|
|
{
|
|
|
|
extern Tcl_CmdProc studButtonCmd;
|
|
|
|
extern Tcl_CmdProc triButtonCmd;
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp, "studbutton", studButtonCmd,
|
|
|
|
(ClientData) main, NULL);
|
|
|
|
Tcl_CreateCommand(interp, "tributton", triButtonCmd,
|
|
|
|
(ClientData) main, NULL);
|
|
|
|
}
|
1994-06-27 05:00:16 -03:00
|
|
|
#endif
|
1997-05-14 16:22:11 -03:00
|
|
|
|
|
|
|
#ifdef WITH_PIL /* 0.2b5 and later -- not yet released as of May 14 */
|
|
|
|
{
|
|
|
|
extern void TkImaging_Init(Tcl_Interp *interp);
|
|
|
|
TkImaging_Init(interp);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_PIL_OLD /* 0.2b4 and earlier */
|
|
|
|
{
|
|
|
|
extern void TkImaging_Init(void);
|
|
|
|
TkImaging_Init();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1997-11-19 14:56:17 -04:00
|
|
|
#ifdef WITH_TIX
|
|
|
|
if (Tix_Init (interp) == TCL_ERROR) {
|
|
|
|
fprintf(stderr, "Tix_Init error: #s\n", interp->result);
|
|
|
|
return TCL_ERROR;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_BLT
|
|
|
|
if (Blt_Init(interp) != TCL_OK) {
|
|
|
|
fprintf(stderr, "BLT_Init error: #s\n", interp->result);
|
|
|
|
return TCL_ERROR;
|
|
|
|
}
|
|
|
|
Tcl_StaticPackage(interp, "Blt", Blt_Init, Blt_SafeInit);
|
|
|
|
#endif
|
|
|
|
|
1994-06-27 05:00:16 -03:00
|
|
|
#ifdef WITH_XXX
|
|
|
|
|
|
|
|
#endif
|
1997-01-14 13:36:36 -04:00
|
|
|
return TCL_OK;
|
1994-06-27 05:00:16 -03:00
|
|
|
}
|