Itk - the [incr Tk] extension

Check-in [0bd0be830c]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Similar changes to the PropagatePublicVariable machinery.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | experiment
Files: files | file ages | folders
SHA1: 0bd0be830c7c05e15aa0905fb6098306e6c43391
User & Date: dgp 2017-07-27 16:31:38
Context
2017-07-28
15:57
Take care that the right commands are resolved in the right namespaces. Closed-Leaf check-in: fd54e0d1dc user: dgp tags: experiment
2017-07-27
16:31
Similar changes to the PropagatePublicVariable machinery. check-in: 0bd0be830c user: dgp tags: experiment
2017-07-25
20:35
Attempt to make code say clearly what it does, instead of achieving so much with namespace context games. check-in: 4af9618d9b user: dgp tags: experiment
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to generic/itkArchBase.c.

  1593   1593        */
  1594   1594   
  1595   1595       if (result == TCL_OK) {
  1596   1596   	/*
  1597   1597   	 * Casting away CONST of newval only to satisfy Tcl 8.3 and
  1598   1598   	 * earlier headers.
  1599   1599   	 */
         1600  +
         1601  +#if 1
         1602  +	val = ItclSetInstanceVar(interp, Tcl_GetString(ivPtr->fullNamePtr),
         1603  +		NULL, newval, contextObj, ivPtr->iclsPtr);
         1604  +#else
  1600   1605           val = Tcl_SetVar2(interp, Tcl_GetString(ivPtr->fullNamePtr), (char *) NULL,
  1601   1606               (char *) newval, TCL_LEAVE_ERR_MSG);
         1607  +#endif
  1602   1608   
  1603   1609           if (!val) {
  1604   1610               result = TCL_ERROR;
  1605   1611           }
  1606   1612       }
  1607   1613   
  1608   1614       if (result != TCL_OK) {
................................................................................
  1616   1622        *  If this variable has some "config" code, invoke it now.
  1617   1623        *
  1618   1624        *  NOTE:  Invoke the "config" code in the class scope
  1619   1625        *    containing the data member.
  1620   1626        */
  1621   1627       mcode = ivPtr->codePtr;
  1622   1628       if (mcode && mcode->bodyPtr) {
  1623         -        Tcl_Namespace *saveNsPtr;
  1624         -        Itcl_SetCallFrameResolver(interp, ivPtr->iclsPtr->resolvePtr);
  1625         -        saveNsPtr = Tcl_GetCurrentNamespace(interp);
  1626         -        Itcl_SetCallFrameNamespace(interp, ivPtr->iclsPtr->nsPtr);
         1629  +	Tcl_CallFrame frame;
         1630  +
         1631  +	Itcl_PushCallFrame(interp, &frame, ivPtr->iclsPtr->nsPtr, 1);
         1632  +	Itcl_SetContext(interp, contextObj);
         1633  +
  1627   1634           result = Tcl_EvalObjEx(interp, mcode->bodyPtr, 0);
  1628         -        Itcl_SetCallFrameNamespace(interp, saveNsPtr);
         1635  +
         1636  +	Itcl_UnsetContext(interp);
         1637  +	Itcl_PopCallFrame(interp);
  1629   1638   
  1630   1639           if (result == TCL_OK) {
  1631   1640               Tcl_ResetResult(interp);
  1632   1641           } else {
  1633   1642               char msg[256];
  1634   1643               sprintf(msg, "\n    (error in configuration of public variable \"%.100s\")", Tcl_GetString(ivPtr->fullNamePtr));
  1635   1644               Tcl_AddErrorInfo(interp, msg);