Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Much more progress. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | dgp-method-type |
Files: | files | file ages | folders |
SHA1: |
ed739315fd3f67dd88ce353c1fe1c37a |
User & Date: | dgp 2015-08-03 21:01:37 |
Context
2015-08-04
| ||
16:36 | Get the toplevel.test tests passing again. check-in: 6b0ed12502 user: dgp tags: dgp-method-type | |
2015-08-03
| ||
21:01 | Much more progress. check-in: ed739315fd user: dgp tags: dgp-method-type | |
04:20 | Debugging work in progress.... check-in: b8982b983a user: dgp tags: dgp-method-type | |
Changes
Changes to generic/itkArchBase.c.
︙ | ︙ | |||
182 183 184 185 186 187 188 | ItclShowArgs(1, "Itk_ArchCompAddCmd", objc, objv); int newEntry; int result; CONST char *cmd; CONST char *token; CONST char *resultStr; | < > > > | 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | ItclShowArgs(1, "Itk_ArchCompAddCmd", objc, objv); int newEntry; int result; CONST char *cmd; CONST char *token; CONST char *resultStr; char *name; Tcl_Namespace *parserNs; ItclClass *contextClass; ItclClass *ownerClass; ItclObject *contextObj; ArchInfo *info; Tcl_Command accessCmd; Tcl_Obj *objPtr; Tcl_DString buffer; #if 0 Tcl_CallFrame frame; Tcl_CallFrame *uplevelFramePtr; Tcl_CallFrame *oldFramePtr = NULL; ItclObjectInfo *infoPtr; ItclCallContext *callContextPtr; #endif /* * Get the Archetype info associated with this widget. */ contextClass = NULL; if (Itcl_GetContext(interp, &contextClass, &contextObj) != TCL_OK || !contextObj) { |
︙ | ︙ | |||
309 310 311 312 313 314 315 | Itcl_SetCallFrameResolver(interp, contextClass->resolvePtr); infoPtr = Tcl_GetAssocData(interp, ITCL_INTERP_DATA, NULL); uplevelFramePtr = Itcl_GetUplevelCallFrame(interp, 1); oldFramePtr = Itcl_ActivateCallFrame(interp, uplevelFramePtr); #endif result = Tcl_EvalObjEx(interp, objv[2], 0); if (result != TCL_OK) { | < | 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | Itcl_SetCallFrameResolver(interp, contextClass->resolvePtr); infoPtr = Tcl_GetAssocData(interp, ITCL_INTERP_DATA, NULL); uplevelFramePtr = Itcl_GetUplevelCallFrame(interp, 1); oldFramePtr = Itcl_ActivateCallFrame(interp, uplevelFramePtr); #endif 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 * this, since the interpreter will get used in the mean time. |
︙ | ︙ | |||
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 | Tcl_SetResult(interp, name, TCL_VOLATILE); return TCL_OK; /* * If any errors were encountered, clean up and return. */ compFail: if (oldFramePtr) { (void) Itcl_ActivateCallFrame(interp, oldFramePtr); } if (archComp) { Itk_DelArchComponent(archComp); } if (entry) { Tcl_DeleteHashEntry(entry); } if (path) { | > > | 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | Tcl_SetResult(interp, name, TCL_VOLATILE); return TCL_OK; /* * If any errors were encountered, clean up and return. */ compFail: #if 0 if (oldFramePtr) { (void) Itcl_ActivateCallFrame(interp, oldFramePtr); } #endif if (archComp) { Itk_DelArchComponent(archComp); } if (entry) { Tcl_DeleteHashEntry(entry); } if (path) { |
︙ | ︙ | |||
825 826 827 828 829 830 831 | cmdlinePtr = Itk_CreateConfigCmdline(interp, mergeInfo->archComp->accessCmd, token); optPart = Itk_CreateOptionPart(interp, (ClientData)cmdlinePtr, Itk_PropagateOption, Itk_DeleteConfigCmdline, (ClientData)mergeInfo->archComp); | < < < < < | 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 | cmdlinePtr = Itk_CreateConfigCmdline(interp, mergeInfo->archComp->accessCmd, token); optPart = Itk_CreateOptionPart(interp, (ClientData)cmdlinePtr, Itk_PropagateOption, Itk_DeleteConfigCmdline, (ClientData)mergeInfo->archComp); result = Itk_AddOptionPart(interp, mergeInfo->archInfo, opt->switchName, opt->resName, opt->resClass, opt->init, opt->value, optPart, &archOpt); if (result == TCL_OK) { opt->integrated = archOpt; opt->optPart = optPart; } else { Itk_DelOptionPart(optPart); result = TCL_ERROR; break; } } return result; } |
︙ | ︙ | |||
1726 1727 1728 1729 1730 1731 1732 | Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "unknown option \"", name, "\"", (char*)NULL); return TCL_ERROR; } archOpt = (ArchOption*)Tcl_GetHashValue(entry); | < < | 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 | Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "unknown option \"", name, "\"", (char*)NULL); return TCL_ERROR; } archOpt = (ArchOption*)Tcl_GetHashValue(entry); if (!Tcl_SetVar2(interp, "itk_option", archOpt->switchName, (const char *)value, 0)) { Itk_ArchOptAccessError(interp, info, archOpt); return TCL_ERROR; } return TCL_OK; } |
︙ | ︙ | |||
1801 1802 1803 1804 1805 1806 1807 | } else { lastval = NULL; } /* * Update the "itk_option" array with the new setting. */ | < < | 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 | } else { lastval = NULL; } /* * Update the "itk_option" array with the new setting. */ if (!Tcl_SetVar2(interp, "itk_option", archOpt->switchName, value, 0)) { Itk_ArchOptAccessError(interp, info, archOpt); result = TCL_ERROR; goto configDone; } /* |
︙ | ︙ | |||
1835 1836 1837 1838 1839 1840 1841 | * If the option configuration failed, then set the option * back to its previous settings. Scan back through all of * the option parts and sync them up with the old value. */ if (result == TCL_ERROR) { istate = Itcl_SaveInterpState(interp, result); | < < | 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 | * If the option configuration failed, then set the option * back to its previous settings. Scan back through all of * the option parts and sync them up with the old value. */ if (result == TCL_ERROR) { istate = Itcl_SaveInterpState(interp, result); Tcl_SetVar2(interp, "itk_option", archOpt->switchName, lastval, 0); part = Itcl_FirstListElem(&archOpt->parts); while (part) { optPart = (ArchOptionPart*)Itcl_GetListValue(part); (*optPart->configProc)(interp, info->itclObj, optPart->clientData, lastval); |
︙ | ︙ | |||
2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 | ArchInfo *info, /* info for Archetype mega-widget */ ArchOption *archOpt, /* option to initialize */ CONST char *defVal, /* last-resort default value */ char *currVal) /* current option value */ { CONST char *init = NULL; Tcl_CallFrame frame; int result; CONST char *ival; char c; /* * If the option is already initialized, then abort. */ if (archOpt->init) { | > > | 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 | ArchInfo *info, /* info for Archetype mega-widget */ ArchOption *archOpt, /* option to initialize */ CONST char *defVal, /* last-resort default value */ char *currVal) /* current option value */ { CONST char *init = NULL; #if 0 Tcl_CallFrame frame; int result; #endif CONST char *ival; char c; /* * If the option is already initialized, then abort. */ if (archOpt->init) { |
︙ | ︙ | |||
2187 2188 2189 2190 2191 2192 2193 | (c == 'v' && strcmp(archOpt->switchName,"-visual") == 0)) { ival = currVal; } else { ival = init; } #if 1 | < < < < < < < < < | 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 | (c == 'v' && strcmp(archOpt->switchName,"-visual") == 0)) { ival = currVal; } else { ival = init; } #if 1 Tcl_SetVar2(interp, "itk_option", archOpt->switchName, (char *)((ival) ? ival : ""), 0); #else /* * Set the initial value in the itk_option array. * Since this might be called from the itk::option-parser * namespace, reinstall the object context. */ result = Itcl_PushCallFrame(interp, &frame, info->itclObj->iclsPtr->nsPtr, /*isProcCallFrame*/0); |
︙ | ︙ | |||
2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 | CONST char *defVal, /* last-resort default value */ char *currVal, /* current value (or NULL) */ ArchOptionPart *optPart, /* part to be added in */ ArchOption **raOpt) /* returns: option containing new part */ { CONST char *init = NULL; Tcl_CallFrame frame; int result; ArchOption *archOpt; *raOpt = NULL; archOpt = NULL; /* | > > | 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 | CONST char *defVal, /* last-resort default value */ char *currVal, /* current value (or NULL) */ ArchOptionPart *optPart, /* part to be added in */ ArchOption **raOpt) /* returns: option containing new part */ { CONST char *init = NULL; #if 0 Tcl_CallFrame frame; #endif int result; ArchOption *archOpt; *raOpt = NULL; archOpt = NULL; /* |
︙ | ︙ | |||
2367 2368 2369 2370 2371 2372 2373 | * simply update this part to the current value. Otherwise, * leave the configuration to Itk_ArchInitCmd(). */ Itcl_AppendList(&archOpt->parts, (ClientData)optPart); if ((archOpt->flags & ITK_ARCHOPT_INIT) != 0) { | | | | 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 | * simply update this part to the current value. Otherwise, * leave the configuration to Itk_ArchInitCmd(). */ Itcl_AppendList(&archOpt->parts, (ClientData)optPart); if ((archOpt->flags & ITK_ARCHOPT_INIT) != 0) { // result = Itcl_PushCallFrame(interp, &frame, info->itclObj->iclsPtr->nsPtr, /*isProcCallFrame*/0); if (result == TCL_OK) { init = Tcl_GetVar2(interp, "itk_option", archOpt->switchName, 0); // Itcl_PopCallFrame(interp); } if (!init) { Itk_ArchOptAccessError(interp, info, archOpt); return TCL_ERROR; } |
︙ | ︙ |
Changes to generic/itkArchetype.c.
︙ | ︙ | |||
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 | Itcl_ListElem *part; ArchOption *archOpt; ArchOptionPart *optPart; ItclHierIter hier; ItclVariable *ivPtr; Tcl_HashSearch place; Tcl_HashEntry *entry; ItclObjectInfo *infoPtr; ItclCallContext *callContextPtr; Tcl_HashEntry *hPtr; ItclShowArgs(2, "Itk_ArchInitCmd", objc, objv); contextClass = NULL; if (Itcl_GetContext(interp, &contextClass, &contextObj) != TCL_OK || !contextObj) { token = Tcl_GetString(objv[0]); Tcl_ResetResult(interp); Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "improper usage: should be \"object ", token, " ?-option value -option value...?\"", (char*)NULL); return TCL_ERROR; } infoPtr = (ItclObjectInfo *)Tcl_GetAssocData(interp, ITCL_INTERP_DATA, NULL); if (Itk_GetArchInfo(interp, contextObj, &info) != TCL_OK) { return TCL_ERROR; } /* * See what class is being initialized by getting the namespace * for the calling context. | > > > > | 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 | Itcl_ListElem *part; ArchOption *archOpt; ArchOptionPart *optPart; ItclHierIter hier; ItclVariable *ivPtr; Tcl_HashSearch place; Tcl_HashEntry *entry; #if 0 ItclObjectInfo *infoPtr; ItclCallContext *callContextPtr; Tcl_HashEntry *hPtr; #endif ItclShowArgs(2, "Itk_ArchInitCmd", objc, objv); contextClass = NULL; if (Itcl_GetContext(interp, &contextClass, &contextObj) != TCL_OK || !contextObj) { token = Tcl_GetString(objv[0]); Tcl_ResetResult(interp); Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "improper usage: should be \"object ", token, " ?-option value -option value...?\"", (char*)NULL); return TCL_ERROR; } #if 0 infoPtr = (ItclObjectInfo *)Tcl_GetAssocData(interp, ITCL_INTERP_DATA, NULL); #endif if (Itk_GetArchInfo(interp, contextObj, &info) != TCL_OK) { return TCL_ERROR; } /* * See what class is being initialized by getting the namespace * for the calling context. |
︙ | ︙ | |||
566 567 568 569 570 571 572 | (char *)callContextPtr->nsPtr); if (hPtr != NULL) { contextClass = (ItclClass *)Tcl_GetHashValue(hPtr); } #endif | | | | 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | (char *)callContextPtr->nsPtr); if (hPtr != NULL) { contextClass = (ItclClass *)Tcl_GetHashValue(hPtr); } #endif //fprintf(stdout, "INIT context class = '%s'\n", //Tcl_GetString(contextClass->fullNamePtr)); fflush(stdout); /* * Integrate all public variables for the current class * context into the composite option list. */ Itcl_InitHierIter(&hier, contextClass); while ((iclsPtr=Itcl_AdvanceHierIter(&hier)) != NULL) { entry = Tcl_FirstHashEntry(&iclsPtr->variables, &place); |
︙ | ︙ | |||
676 677 678 679 680 681 682 | * Invoke the parts of uninitialized options to propagate * changes and update the widget. */ if (contextObj->iclsPtr == contextClass) { for (i=0; i < info->order.len; i++) { archOpt = (ArchOption*)Tcl_GetHashValue(info->order.list[i]); | | | | | | | 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | * Invoke the parts of uninitialized options to propagate * changes and update the widget. */ if (contextObj->iclsPtr == contextClass) { for (i=0; i < info->order.len; i++) { archOpt = (ArchOption*)Tcl_GetHashValue(info->order.list[i]); //fprintf(stdout, "GETTING VAR...\n"); fflush(stdout); if ((archOpt->flags & ITK_ARCHOPT_INIT) == 0) { val = Tcl_GetVar2(interp, "itk_option", archOpt->switchName, 0); if (!val) { //fprintf(stdout, "INIT context class = '%s' object='%s'\n", //Tcl_GetString(contextClass->fullNamePtr), //Tcl_GetString(contextObj->namePtr) //); fflush(stdout); Itk_ArchOptAccessError(interp, info, archOpt); return TCL_ERROR; } part = Itcl_FirstListElem(&archOpt->parts); while (part) { optPart = (ArchOptionPart*)Itcl_GetListValue(part); |
︙ | ︙ |
Changes to library/Widget.itk.
︙ | ︙ | |||
36 37 38 39 40 41 42 | constructor {args} { # # Create a window with the same name as this object # set itk_hull [namespace tail $this] set itk_interior $itk_hull | < < | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | constructor {args} { # # Create a window with the same name as this object # set itk_hull [namespace tail $this] set itk_interior $itk_hull itk_component add hull { frame $itk_hull -class [namespace tail [info class]] } { keep -background -cursor } bind itk-delete-$itk_hull <Destroy> [list itcl::delete object $this] set tags [bindtags $itk_hull] bindtags $itk_hull [linsert $tags 0 itk-delete-$itk_hull] |
︙ | ︙ |
Changes to tests/option.test.
︙ | ︙ | |||
66 67 68 69 70 71 72 | test option-1.2 {"keep" can be called more than once} { .testOptWidget0 do { itk_component add k0 { TestOptComp $itk_interior.k0 -status "create" } { keep -background -foreground -cursor | | | | | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | test option-1.2 {"keep" can be called more than once} { .testOptWidget0 do { itk_component add k0 { TestOptComp $itk_interior.k0 -status "create" } { keep -background -foreground -cursor keep -background -foreground -cursor keep -status keep -status } pack $itk_component(k0) } .testOptWidget0 configure -status "foo" .testOptWidget0 component k0 do {set status} } {create foo} |
︙ | ︙ |