Posted to tcl by dgp at Fri Dec 12 17:54:50 GMT 2008view raw

  1.  
  2. #undef USE_TCL_STUBS
  3. #include "tcl.h"
  4. #define USE_TK_STUBS
  5. #include "tk.h"
  6.  
  7. int appInitProc(Tcl_Interp *interp) {
  8. return TCL_OK;
  9. }
  10.  
  11. int main(int argc, char **argv) {
  12. Tcl_Interp *interp = Tcl_CreateInterp();
  13.  
  14. if (Tcl_Init(interp) == TCL_ERROR) {
  15. Tcl_Panic("borked Tcl install!");
  16. }
  17. #undef Tcl_InitStubs
  18. if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
  19. Tcl_Panic("Cannot init Tcl stubs!");
  20. }
  21. if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) {
  22. Tcl_Panic("Cannot find Tk!");
  23. }
  24. Tk_MainEx(argc, argv, appInitProc, interp);
  25. }
  26.