Tcl Source Code

Check-in [4701561332]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:* defined an init script with TclSetPreInitScript() which permits us to use [interp create] without hunting around for an init.tcl file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ferrieux-nacl
Files: files | file ages | folders
SHA1: 47015613323f749e14016915f0f95d5c229a5f23
User & Date: colin 2011-05-04 23:49:49
Context
2011-05-05
07:51
* mods for NaTk check-in: d3a2b330e6 user: colin tags: ferrieux-nacl
2011-05-04
23:49
* defined an init script with TclSetPreInitScript() which permits us to use [interp create] without ... check-in: 4701561332 user: colin tags: ferrieux-nacl
03:22
* left out updateCoords, added it back into balls.html pending final disposition check-in: 43996dcdef user: colin tags: ferrieux-nacl
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to nacl/init.natcl.

113
114
115
116
117
118
119




    nacl js "setInterval(function(){tclDo([::nacl::jsquote $script]);},$ms)"
}

# Delayed DOM-setting through the tclDo() trampoline
proc ::domset {element inner} {
    nacl js "$element.innerHTML=[::nacl::jsquote $inner]"
}











>
>
>
>
113
114
115
116
117
118
119
120
121
122
123
    nacl js "setInterval(function(){tclDo([::nacl::jsquote $script]);},$ms)"
}

# Delayed DOM-setting through the tclDo() trampoline
proc ::domset {element inner} {
    nacl js "$element.innerHTML=[::nacl::jsquote $inner]"
}

proc tclInit {} {
        printf "### tclInit called"
}

Changes to nacl/naclMain.c.

64
65
66
67
68
69
70

71
72
73
74
75
76
77
  //printf("DBUG:Tcl_Init2\n");
  if (Tcl_Eval(ii,init_tcl_contents)!=TCL_OK) {
    printf("NaTcl(%d): Tcl Init Failed: %s !!!\n",pid,Tcl_GetStringResult(ii));
    return NULL;
  }
  Tcl_CreateObjCommand(ii,"printf",PrintfObjCmd,NULL,NULL);
  Tcl_LinkVar(ii, "::nacl::verbose", (char *)&verbose, TCL_LINK_INT);

  return ii;
}

static const char *EvalTcl(char *s)
{
  if (!interp) return "No Tcl Interp!!!";
  Tcl_Eval(interp,s);







>







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  //printf("DBUG:Tcl_Init2\n");
  if (Tcl_Eval(ii,init_tcl_contents)!=TCL_OK) {
    printf("NaTcl(%d): Tcl Init Failed: %s !!!\n",pid,Tcl_GetStringResult(ii));
    return NULL;
  }
  Tcl_CreateObjCommand(ii,"printf",PrintfObjCmd,NULL,NULL);
  Tcl_LinkVar(ii, "::nacl::verbose", (char *)&verbose, TCL_LINK_INT);
  TclSetPreInitScript("proc ::tclInit {} {}");
  return ii;
}

static const char *EvalTcl(char *s)
{
  if (!interp) return "No Tcl Interp!!!";
  Tcl_Eval(interp,s);