#include "tk.h"

int Tcl_AppInit(Tcl_Interp *interp) {
    if (Tcl_Init(interp) == TCL_ERROR) return TCL_ERROR;

    /* Use a "wish" console, not the proces standard channels. */
    Tk_InitConsoleChannels(interp);

    if (Tk_Init(interp) == TCL_ERROR) return TCL_ERROR;
    Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);

    /* Create the "wish" console */
    if (Tk_CreateConsoleWindow(interp) != TCL_OK) return TCL_ERROR;

    return TCL_OK;
}

int main(int argc, char **argv) {
    Tk_Main(argc, argv, Tcl_AppInit);
    return 0;
}

