Itk - the [incr Tk] extension

Check-in [8bbba9e282]
Login

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

Overview
Comment:fix for SF bug #2840994
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | itcl-ng
Files: files | file ages | folders
SHA1: 8bbba9e28209072a618754cbb2527145edff71e2
User & Date: wiede 2009-10-23 16:37:35.000
Context
2009-10-23
16:57
bumped version to 4.0b4 check-in: 5ddf44098e user: wiede tags: itcl-ng
16:37
fix for SF bug #2840994 check-in: 8bbba9e282 user: wiede tags: itcl-ng
16:36
bumped version to 4.0b3 check-in: 8605143607 user: wiede tags: itcl-ng
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/itkArchBase.c.
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           http://www.tcltk.com/itcl
 *
 *     RCS:  $Id: itkArchBase.c,v 1.1.2.7 2008/10/19 16:56:34 wiede Exp $
 * ========================================================================
 *           Copyright (c) 1993-1998  Lucent Technologies, Inc.
 * ------------------------------------------------------------------------
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */
#include <assert.h>







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           http://www.tcltk.com/itcl
 *
 *     RCS:  $Id: itkArchBase.c,v 1.1.2.8 2009/10/23 16:37:35 wiede Exp $
 * ========================================================================
 *           Copyright (c) 1993-1998  Lucent Technologies, Inc.
 * ------------------------------------------------------------------------
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */
#include <assert.h>
194
195
196
197
198
199
200




201
202
203
204
205
206
207
    ItclClass *contextClass;
    ItclClass *ownerClass;
    ItclObject *contextObj;
    ArchInfo *info;
    Tcl_Command accessCmd;
    Tcl_Obj *objPtr;
    Tcl_DString buffer;





    /*
     *  Get the Archetype info associated with this widget.
     */
    contextClass = NULL;
    if (Itcl_GetContext(interp, &contextClass, &contextObj) != TCL_OK ||
        !contextObj) {







>
>
>
>







194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
    ItclClass *contextClass;
    ItclClass *ownerClass;
    ItclObject *contextObj;
    ArchInfo *info;
    Tcl_Command accessCmd;
    Tcl_Obj *objPtr;
    Tcl_DString buffer;
    Tcl_CallFrame *uplevelFramePtr;
    Tcl_CallFrame *oldFramePtr;
    ItclObjectInfo *infoPtr;
    ItclCallContext *callContextPtr;

    /*
     *  Get the Archetype info associated with this widget.
     */
    contextClass = NULL;
    if (Itcl_GetContext(interp, &contextClass, &contextObj) != TCL_OK ||
        !contextObj) {
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
    }

    /*
     *  Execute the <createCmds> to create the component widget.
     *  Do this one level up, in the scope of the calling routine.
     */
    Itcl_SetCallFrameResolver(interp, contextClass->resolvePtr);
    Tcl_Namespace *saveNsPtr = Tcl_GetCurrentNamespace(interp);
    ItclObjectInfo *infoPtr;
    infoPtr = Tcl_GetAssocData(interp, ITCL_INTERP_DATA, NULL);
    int idx;
    idx = 2;
    if (Itcl_GetStackSize(&infoPtr->contextStack) == 1) {
	    idx = 1;
    }
    ItclCallContext *callContextPtr;
    callContextPtr = Itcl_GetStackValue(&infoPtr->contextStack,
            Itcl_GetStackSize(&infoPtr->contextStack)-idx);
    Itcl_SetCallFrameNamespace(interp, callContextPtr->nsPtr);
    result = Tcl_EvalObjEx(interp, objv[2], 0);
    Itcl_SetCallFrameNamespace(interp, saveNsPtr);
    if (result != TCL_OK) {
        goto compFail;
    }

    /*
     *  Take the result from the widget creation commands as the
     *  path name for the new component.  Make a local copy of







<
<

<
<
<
<
<
<
|
<
|

<







304
305
306
307
308
309
310


311






312

313
314

315
316
317
318
319
320
321
    }

    /*
     *  Execute the <createCmds> to create the component widget.
     *  Do this one level up, in the scope of the calling routine.
     */
    Itcl_SetCallFrameResolver(interp, contextClass->resolvePtr);


    infoPtr = Tcl_GetAssocData(interp, ITCL_INTERP_DATA, NULL);






    uplevelFramePtr = Itcl_GetUplevelCallFrame(interp, 1);

    oldFramePtr = Itcl_ActivateCallFrame(interp, uplevelFramePtr);
    result = Tcl_EvalObjEx(interp, objv[2], 0);

    if (result != TCL_OK) {
        goto compFail;
    }

    /*
     *  Take the result from the widget creation commands as the
     *  path name for the new component.  Make a local copy of
343
344
345
346
347
348
349

350
351
352
353
354
355
356
        Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
           "cannot find component access command \"",
            path, "\" for component \"", name, "\"",
            (char*)NULL);
        goto compFail;
    }


    winNamePtr = Tcl_NewStringObj((char*)NULL, 0);
    Tcl_GetCommandFullName(interp, accessCmd, winNamePtr);
    Tcl_IncrRefCount(winNamePtr);


    /*
     *  Create the component record.  Set the protection level







>







337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
        Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
           "cannot find component access command \"",
            path, "\" for component \"", name, "\"",
            (char*)NULL);
        goto compFail;
    }

    (void) Itcl_ActivateCallFrame(interp, oldFramePtr);
    winNamePtr = Tcl_NewStringObj((char*)NULL, 0);
    Tcl_GetCommandFullName(interp, accessCmd, winNamePtr);
    Tcl_IncrRefCount(winNamePtr);


    /*
     *  Create the component record.  Set the protection level