Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Eliminate all usage of functions Tcl_VarEval (deprecated) and Tcl_Eval (to the prefered Tcl_EvalEx). |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
0deef053f656e065cb0bb8410a0584bc |
User & Date: | jan.nijtmans 2013-03-07 14:49:40 |
Original Comment: | Eliminate all usage of (deprecated) functions Tcl_VarEval and Tcl_Eval. |
References
2020-06-06
| ||
07:49 | • Closed ticket [2790615f]: update performs Tk callbacks in its own stack frame plus 8 other changes artifact: b83110e0 user: fvogel | |
07:45 | Update leftover comments that didn't follow the changes made in [0deef053f6] check-in: a97bc436 user: fvogel tags: trunk | |
07:45 | Update leftover comments that didn't follow the changes made in [0deef053f6] check-in: 6ae2a281 user: fvogel tags: core-8-6-branch | |
04:17 | • Ticket [2790615f] update performs Tk callbacks in its own stack frame status still Open with 7 other changes artifact: 75303879 user: chrstphrchvz | |
Context
2013-03-11
| ||
18:39 | 3607326 Stop segfault from [listbox .l -listvariable $array]. check-in: e8c5b9dd user: dgp tags: trunk | |
2013-03-08
| ||
16:08 | Possible (partial) fix for [Bug 3607250] Leaf check-in: ceea1367 user: jan.nijtmans tags: bug-3607250 | |
2013-03-07
| ||
21:59 | Proposed patch by kjnash. Committed in [1f184c7377] Closed-Leaf check-in: 62653578 user: jan.nijtmans tags: bug-3607248 | |
15:24 | Add TCL_EVAL_GLOBAL everywhere, this is actually how it should have been. (Still to be tested on UNIX) check-in: 2169ca59 user: jan.nijtmans tags: dgp-review | |
14:49 | Eliminate all usage of functions Tcl_VarEval (deprecated) and Tcl_Eval (to the prefered Tcl_EvalEx). check-in: 0deef053 user: jan.nijtmans tags: trunk | |
2013-02-28
| ||
09:38 | minor: tidy up change log formatting check-in: 3160fe33 user: dkf tags: trunk | |
Changes
Changes to generic/tkCanvPs.c.
︙ | ︙ | |||
189 190 191 192 193 194 195 | /* * Get the generic preamble. We only ever bother with the ASCII encoding; * the others just make life too complicated and never actually worked as * such. */ | | | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | /* * Get the generic preamble. We only ever bother with the ASCII encoding; * the others just make life too complicated and never actually worked as * such. */ result = Tcl_EvalEx(interp, "::tk::ensure_psenc_is_loaded", -1, 0); if (result != TCL_OK) { return result; } preambleObj = Tcl_GetVar2Ex(interp, "::tk::ps_preamble", NULL, TCL_LEAVE_ERR_MSG); if (preambleObj == NULL) { return TCL_ERROR; |
︙ | ︙ |
Changes to generic/tkCanvas.c.
︙ | ︙ | |||
5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 | TkCanvas *canvasPtr) /* Information about canvas. */ { int result; Tcl_Interp *interp; int xOrigin, yOrigin, inset, width, height; int scrollX1, scrollX2, scrollY1, scrollY2; char *xScrollCmd, *yScrollCmd; /* * Save all the relevant values from the canvasPtr, because it might be * deleted as part of either of the two calls to Tcl_VarEval below. */ interp = canvasPtr->interp; | > | 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 | TkCanvas *canvasPtr) /* Information about canvas. */ { int result; Tcl_Interp *interp; int xOrigin, yOrigin, inset, width, height; int scrollX1, scrollX2, scrollY1, scrollY2; char *xScrollCmd, *yScrollCmd; Tcl_DString buf; /* * Save all the relevant values from the canvasPtr, because it might be * deleted as part of either of the two calls to Tcl_VarEval below. */ interp = canvasPtr->interp; |
︙ | ︙ | |||
5566 5567 5568 5569 5570 5571 5572 | scrollY1 = canvasPtr->scrollY1; scrollY2 = canvasPtr->scrollY2; canvasPtr->flags &= ~UPDATE_SCROLLBARS; if (canvasPtr->xScrollCmd != NULL) { Tcl_Obj *fractions = ScrollFractions(xOrigin + inset, xOrigin + width - inset, scrollX1, scrollX2); | > > > | > | > > > | > | | 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 | scrollY1 = canvasPtr->scrollY1; scrollY2 = canvasPtr->scrollY2; canvasPtr->flags &= ~UPDATE_SCROLLBARS; if (canvasPtr->xScrollCmd != NULL) { Tcl_Obj *fractions = ScrollFractions(xOrigin + inset, xOrigin + width - inset, scrollX1, scrollX2); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, xScrollCmd, -1); Tcl_DStringAppend(&buf, " ", -1); Tcl_DStringAppend(&buf, Tcl_GetString(fractions), -1); result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); Tcl_DecrRefCount(fractions); if (result != TCL_OK) { Tcl_BackgroundException(interp, result); } Tcl_ResetResult(interp); Tcl_Release(xScrollCmd); } if (yScrollCmd != NULL) { Tcl_Obj *fractions = ScrollFractions(yOrigin + inset, yOrigin + height - inset, scrollY1, scrollY2); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, yScrollCmd, -1); Tcl_DStringAppend(&buf, " ", -1); Tcl_DStringAppend(&buf, Tcl_GetString(fractions), -1); result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); Tcl_DecrRefCount(fractions); if (result != TCL_OK) { Tcl_BackgroundException(interp, result); } Tcl_ResetResult(interp); Tcl_Release(yScrollCmd); } |
︙ | ︙ |
Changes to generic/tkEntry.c.
︙ | ︙ | |||
2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 | EntryUpdateScrollbar( Entry *entryPtr) /* Information about widget. */ { char firstStr[TCL_DOUBLE_SPACE], lastStr[TCL_DOUBLE_SPACE]; int code; double first, last; Tcl_Interp *interp; if (entryPtr->scrollCmd == NULL) { return; } interp = entryPtr->interp; Tcl_Preserve(interp); EntryVisibleRange(entryPtr, &first, &last); Tcl_PrintDouble(NULL, first, firstStr); Tcl_PrintDouble(NULL, last, lastStr); | > > | > > > | > > | 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 | EntryUpdateScrollbar( Entry *entryPtr) /* Information about widget. */ { char firstStr[TCL_DOUBLE_SPACE], lastStr[TCL_DOUBLE_SPACE]; int code; double first, last; Tcl_Interp *interp; Tcl_DString buf; if (entryPtr->scrollCmd == NULL) { return; } interp = entryPtr->interp; Tcl_Preserve(interp); EntryVisibleRange(entryPtr, &first, &last); Tcl_PrintDouble(NULL, first, firstStr); Tcl_PrintDouble(NULL, last, lastStr); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, entryPtr->scrollCmd, -1); Tcl_DStringAppend(&buf, " ", -1); Tcl_DStringAppend(&buf, firstStr, -1); Tcl_DStringAppend(&buf, " ", -1); Tcl_DStringAppend(&buf, lastStr, -1); code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); if (code != TCL_OK) { Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( "\n (horizontal scrolling command executed by %s)", Tk_PathName(entryPtr->tkwin))); Tcl_BackgroundException(interp, code); } Tcl_ResetResult(interp); |
︙ | ︙ |
Changes to generic/tkListbox.c.
︙ | ︙ | |||
3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 | ListboxUpdateVScrollbar( register Listbox *listPtr) /* Information about widget. */ { char firstStr[TCL_DOUBLE_SPACE], lastStr[TCL_DOUBLE_SPACE]; double first, last; int result; Tcl_Interp *interp; if (listPtr->yScrollCmd == NULL) { return; } if (listPtr->nElements == 0) { first = 0.0; last = 1.0; | > | 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 | ListboxUpdateVScrollbar( register Listbox *listPtr) /* Information about widget. */ { char firstStr[TCL_DOUBLE_SPACE], lastStr[TCL_DOUBLE_SPACE]; double first, last; int result; Tcl_Interp *interp; Tcl_DString buf; if (listPtr->yScrollCmd == NULL) { return; } if (listPtr->nElements == 0) { first = 0.0; last = 1.0; |
︙ | ︙ | |||
3265 3266 3267 3268 3269 3270 3271 | /* * We must hold onto the interpreter from the listPtr because the data at * listPtr might be freed as a result of the Tcl_VarEval. */ interp = listPtr->interp; Tcl_Preserve(interp); | > | > > > | > > | 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 | /* * We must hold onto the interpreter from the listPtr because the data at * listPtr might be freed as a result of the Tcl_VarEval. */ interp = listPtr->interp; Tcl_Preserve(interp); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, listPtr->yScrollCmd, -1); Tcl_DStringAppend(&buf, " ", -1); Tcl_DStringAppend(&buf, firstStr, -1); Tcl_DStringAppend(&buf, " ", -1); Tcl_DStringAppend(&buf, lastStr, -1); result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); if (result != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (vertical scrolling command executed by listbox)"); Tcl_BackgroundException(interp, result); } Tcl_Release(interp); } |
︙ | ︙ | |||
3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 | ListboxUpdateHScrollbar( register Listbox *listPtr) /* Information about widget. */ { char firstStr[TCL_DOUBLE_SPACE], lastStr[TCL_DOUBLE_SPACE]; int result, windowWidth; double first, last; Tcl_Interp *interp; if (listPtr->xScrollCmd == NULL) { return; } windowWidth = Tk_Width(listPtr->tkwin) - 2*(listPtr->inset + listPtr->selBorderWidth); | > | 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 | ListboxUpdateHScrollbar( register Listbox *listPtr) /* Information about widget. */ { char firstStr[TCL_DOUBLE_SPACE], lastStr[TCL_DOUBLE_SPACE]; int result, windowWidth; double first, last; Tcl_Interp *interp; Tcl_DString buf; if (listPtr->xScrollCmd == NULL) { return; } windowWidth = Tk_Width(listPtr->tkwin) - 2*(listPtr->inset + listPtr->selBorderWidth); |
︙ | ︙ | |||
3330 3331 3332 3333 3334 3335 3336 | /* * We must hold onto the interpreter because the data referred to at * listPtr might be freed as a result of the call to Tcl_VarEval. */ interp = listPtr->interp; Tcl_Preserve(interp); | > | > > > | > > | 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 | /* * We must hold onto the interpreter because the data referred to at * listPtr might be freed as a result of the call to Tcl_VarEval. */ interp = listPtr->interp; Tcl_Preserve(interp); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, listPtr->xScrollCmd, -1); Tcl_DStringAppend(&buf, " ", -1); Tcl_DStringAppend(&buf, firstStr, -1); Tcl_DStringAppend(&buf, " ", -1); Tcl_DStringAppend(&buf, lastStr, -1); result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); if (result != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (horizontal scrolling command executed by listbox)"); Tcl_BackgroundException(interp, result); } Tcl_Release(interp); } |
︙ | ︙ |
Changes to generic/tkMenu.c.
︙ | ︙ | |||
1057 1058 1059 1060 1061 1062 1063 | Tcl_Preserve(mePtr); if (mePtr->type == TEAROFF_ENTRY) { Tcl_DString ds; Tcl_DStringInit(&ds); Tcl_DStringAppend(&ds, "tk::TearOffMenu ", -1); Tcl_DStringAppend(&ds, Tk_PathName(menuPtr->tkwin), -1); | | | 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 | Tcl_Preserve(mePtr); if (mePtr->type == TEAROFF_ENTRY) { Tcl_DString ds; Tcl_DStringInit(&ds); Tcl_DStringAppend(&ds, "tk::TearOffMenu ", -1); Tcl_DStringAppend(&ds, Tk_PathName(menuPtr->tkwin), -1); result = Tcl_EvalEx(interp, Tcl_DStringValue(&ds), -1, 0); Tcl_DStringFree(&ds); } else if ((mePtr->type == CHECK_BUTTON_ENTRY) && (mePtr->namePtr != NULL)) { Tcl_Obj *valuePtr; if (mePtr->entryFlags & ENTRY_SELECTED) { valuePtr = mePtr->offValuePtr; |
︙ | ︙ |
Changes to generic/tkText.c.
︙ | ︙ | |||
4937 4938 4939 4940 4941 4942 4943 4944 | tuple = Tcl_NewListObj(3, values); if (command == NULL) { Tcl_ListObjAppendList(NULL, Tcl_GetObjResult(interp), tuple); Tcl_DecrRefCount(tuple); return 0; } else { int oldStateEpoch = TkBTreeEpoch(textPtr->sharedTextPtr->tree); | > > > | > > > | > > > > > | 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 | tuple = Tcl_NewListObj(3, values); if (command == NULL) { Tcl_ListObjAppendList(NULL, Tcl_GetObjResult(interp), tuple); Tcl_DecrRefCount(tuple); return 0; } else { int oldStateEpoch = TkBTreeEpoch(textPtr->sharedTextPtr->tree); Tcl_DString buf; int code; Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, Tcl_GetString(command), -1); Tcl_DStringAppend(&buf, " ", -1); Tcl_DStringAppend(&buf, Tcl_GetString(tuple), -1); code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); if (code != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (segment dumping command executed by text)"); Tcl_BackgroundException(interp, code); } Tcl_DecrRefCount(tuple); return ((textPtr->flags & DESTROYED) || TkBTreeEpoch(textPtr->sharedTextPtr->tree) != oldStateEpoch); } } /* |
︙ | ︙ |
Changes to generic/tkTextDisp.c.
︙ | ︙ | |||
6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 | return; } dInfoPtr->xScrollFirst = first; dInfoPtr->xScrollLast = last; if (textPtr->xScrollCmd != NULL) { char buf1[TCL_DOUBLE_SPACE+1]; char buf2[TCL_DOUBLE_SPACE+1]; buf1[0] = ' '; buf2[0] = ' '; Tcl_PrintDouble(NULL, first, buf1+1); Tcl_PrintDouble(NULL, last, buf2+1); | > > | > > > > | 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 | return; } dInfoPtr->xScrollFirst = first; dInfoPtr->xScrollLast = last; if (textPtr->xScrollCmd != NULL) { char buf1[TCL_DOUBLE_SPACE+1]; char buf2[TCL_DOUBLE_SPACE+1]; Tcl_DString buf; buf1[0] = ' '; buf2[0] = ' '; Tcl_PrintDouble(NULL, first, buf1+1); Tcl_PrintDouble(NULL, last, buf2+1); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, textPtr->xScrollCmd, -1); Tcl_DStringAppend(&buf, buf1, -1); Tcl_DStringAppend(&buf, buf2, -1); code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); if (code != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (horizontal scrolling command executed by text)"); Tcl_BackgroundException(interp, code); } } } |
︙ | ︙ | |||
6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 | } dInfoPtr->yScrollFirst = first; dInfoPtr->yScrollLast = last; if (textPtr->yScrollCmd != NULL) { char buf1[TCL_DOUBLE_SPACE+1]; char buf2[TCL_DOUBLE_SPACE+1]; buf1[0] = ' '; buf2[0] = ' '; Tcl_PrintDouble(NULL, first, buf1+1); Tcl_PrintDouble(NULL, last, buf2+1); | > > | > > > > | 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 | } dInfoPtr->yScrollFirst = first; dInfoPtr->yScrollLast = last; if (textPtr->yScrollCmd != NULL) { char buf1[TCL_DOUBLE_SPACE+1]; char buf2[TCL_DOUBLE_SPACE+1]; Tcl_DString buf; buf1[0] = ' '; buf2[0] = ' '; Tcl_PrintDouble(NULL, first, buf1+1); Tcl_PrintDouble(NULL, last, buf2+1); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, textPtr->yScrollCmd, -1); Tcl_DStringAppend(&buf, buf1, -1); Tcl_DStringAppend(&buf, buf2, -1); code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); if (code != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (vertical scrolling command executed by text)"); Tcl_BackgroundException(interp, code); } } } |
︙ | ︙ |
Changes to generic/tkWindow.c.
︙ | ︙ | |||
3138 3139 3140 3141 3142 3143 3144 | Tcl_DStringAppendElement(&ds, Tcl_GetString(Tcl_GetObjResult(master))); /* * Step 2 : Eval in the master. The argument is the *reversed* interp * path of the slave. */ | | | 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 | Tcl_DStringAppendElement(&ds, Tcl_GetString(Tcl_GetObjResult(master))); /* * Step 2 : Eval in the master. The argument is the *reversed* interp * path of the slave. */ code = Tcl_EvalEx(master, Tcl_DStringValue(&ds), -1, 0); if (code != TCL_OK) { /* * We might want to transfer the error message or not. We don't. * (No API to do it and maybe security reasons). */ Tcl_DStringFree(&ds); |
︙ | ︙ | |||
3274 3275 3276 3277 3278 3279 3280 3281 | /* * Set the geometry of the main window, if requested. Put the requested * geometry into the "geometry" variable. */ if (geometry != NULL) { Tcl_SetVar2(interp, "geometry", NULL, geometry, TCL_GLOBAL_ONLY); | > > > | > > > | 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 | /* * Set the geometry of the main window, if requested. Put the requested * geometry into the "geometry" variable. */ if (geometry != NULL) { Tcl_DString buf; Tcl_SetVar2(interp, "geometry", NULL, geometry, TCL_GLOBAL_ONLY); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, "wm geometry . ", -1); Tcl_DStringAppend(&buf, geometry, -1); code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); if (code != TCL_OK) { goto done; } geometry = NULL; } /* |
︙ | ︙ | |||
3333 3334 3335 3336 3337 3338 3339 | * to perform the search. See the docs for that command for details * on where it looks. * * Note that this entire search mechanism can be bypassed by defining * an alternate [tkInit] command before calling Tk_Init(). */ | | | | 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 | * to perform the search. See the docs for that command for details * on where it looks. * * Note that this entire search mechanism can be bypassed by defining * an alternate [tkInit] command before calling Tk_Init(). */ code = Tcl_EvalEx(interp, "if {[namespace which -command tkInit] eq \"\"} {\n\ proc tkInit {} {\n\ global tk_library tk_version tk_patchLevel\n\ rename tkInit {}\n\ tcl_findLibrary tk $tk_version $tk_patchLevel tk.tcl TK_LIBRARY tk_library\n\ }\n\ }\n\ tkInit", -1, 0); } if (code == TCL_OK) { /* * Create exit handlers to delete all windows when the application or * thread exits. The handler need to be invoked before other platform * specific cleanups take place to avoid panics in finalization. */ |
︙ | ︙ |
Changes to macosx/tkMacOSXHLEvents.c.
︙ | ︙ | |||
541 542 543 544 545 546 547 | theErr = AEGetParamPtr(event, keyDirectObject, typeFSRef, NULL, &file, size, NULL); if (theErr == noErr) { Tcl_DString scriptName; theErr = FSRefToDString(&file, &scriptName); if (theErr == noErr) { | | | 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 | theErr = AEGetParamPtr(event, keyDirectObject, typeFSRef, NULL, &file, size, NULL); if (theErr == noErr) { Tcl_DString scriptName; theErr = FSRefToDString(&file, &scriptName); if (theErr == noErr) { tclErr = Tcl_FSEvalFileEx(interp, Tcl_DStringValue(&scriptName), NULL); Tcl_DStringFree(&scriptName); } else { sprintf(errString, "AEDoScriptHandler: file not found"); AEPutParamPtr(reply, keyErrorString, typeChar, errString, strlen(errString)); } } |
︙ | ︙ |
Changes to macosx/tkMacOSXMenus.c.
︙ | ︙ | |||
212 213 214 215 216 217 218 | Tcl_Obj *path = Tcl_GetObjResult(_eventInterp); int len; Tcl_GetStringFromObj(path, &len); if (len) { Tcl_IncrRefCount(path); | | | | 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | Tcl_Obj *path = Tcl_GetObjResult(_eventInterp); int len; Tcl_GetStringFromObj(path, &len); if (len) { Tcl_IncrRefCount(path); int code = Tcl_FSEvalFileEx(_eventInterp, path, NULL); if (code != TCL_OK) { Tcl_BackgroundException(_eventInterp, code); } Tcl_DecrRefCount(path); } } Tcl_ResetResult(_eventInterp); } } - (void) tkDemo: (id) sender { if (_eventInterp) { Tcl_Obj *path = GetWidgetDemoPath(_eventInterp); if (path) { Tcl_IncrRefCount(path); int code = Tcl_FSEvalFileEx(_eventInterp, path, NULL); if (code != TCL_OK) { Tcl_BackgroundException(_eventInterp, code); } Tcl_DecrRefCount(path); Tcl_ResetResult(_eventInterp); } |
︙ | ︙ |
Changes to macosx/tkMacOSXScale.c.
︙ | ︙ | |||
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | Rect r; WindowRef windowRef; CGrafPtr destPort, savePort; Boolean portChanged; MacDrawable *macDraw; SInt32 initialValue, minValue, maxValue; UInt16 numTicks; #ifdef TK_MAC_DEBUG_SCALE TkMacOSXDbgMsg("TkpDisplayScale"); #endif scalePtr->flags &= ~REDRAW_PENDING; if ((scalePtr->tkwin == NULL) || !Tk_IsMapped(scalePtr->tkwin)) { goto done; } /* * Invoke the scale's command if needed. */ Tcl_Preserve((ClientData) scalePtr); if ((scalePtr->flags & INVOKE_COMMAND) && (scalePtr->command != NULL)) { Tcl_Preserve((ClientData) interp); sprintf(string, scalePtr->format, scalePtr->value); | > > | > > > > | 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | Rect r; WindowRef windowRef; CGrafPtr destPort, savePort; Boolean portChanged; MacDrawable *macDraw; SInt32 initialValue, minValue, maxValue; UInt16 numTicks; Tcl_DString buf; #ifdef TK_MAC_DEBUG_SCALE TkMacOSXDbgMsg("TkpDisplayScale"); #endif scalePtr->flags &= ~REDRAW_PENDING; if ((scalePtr->tkwin == NULL) || !Tk_IsMapped(scalePtr->tkwin)) { goto done; } /* * Invoke the scale's command if needed. */ Tcl_Preserve((ClientData) scalePtr); if ((scalePtr->flags & INVOKE_COMMAND) && (scalePtr->command != NULL)) { Tcl_Preserve((ClientData) interp); sprintf(string, scalePtr->format, scalePtr->value); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, scalePtr->command, -1); Tcl_DStringAppend(&buf, " ", -1); Tcl_DStringAppend(&buf, string, -1); result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); if (result != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (command executed by scale)"); Tcl_BackgroundException(interp, result); } Tcl_Release((ClientData) interp); } scalePtr->flags &= ~INVOKE_COMMAND; |
︙ | ︙ |
Changes to unix/tkUnixScale.c.
︙ | ︙ | |||
533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | TkScale *scalePtr = (TkScale *) clientData; Tk_Window tkwin = scalePtr->tkwin; Tcl_Interp *interp = scalePtr->interp; Pixmap pixmap; int result; char string[PRINT_CHARS]; XRectangle drawnArea; scalePtr->flags &= ~REDRAW_PENDING; if ((scalePtr->tkwin == NULL) || !Tk_IsMapped(scalePtr->tkwin)) { goto done; } /* * Invoke the scale's command if needed. */ Tcl_Preserve(scalePtr); if ((scalePtr->flags & INVOKE_COMMAND) && (scalePtr->command != NULL)) { Tcl_Preserve(interp); sprintf(string, scalePtr->format, scalePtr->value); | > > | < > > > > | 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 563 564 565 566 567 | TkScale *scalePtr = (TkScale *) clientData; Tk_Window tkwin = scalePtr->tkwin; Tcl_Interp *interp = scalePtr->interp; Pixmap pixmap; int result; char string[PRINT_CHARS]; XRectangle drawnArea; Tcl_DString buf; scalePtr->flags &= ~REDRAW_PENDING; if ((scalePtr->tkwin == NULL) || !Tk_IsMapped(scalePtr->tkwin)) { goto done; } /* * Invoke the scale's command if needed. */ Tcl_Preserve(scalePtr); if ((scalePtr->flags & INVOKE_COMMAND) && (scalePtr->command != NULL)) { Tcl_Preserve(interp); sprintf(string, scalePtr->format, scalePtr->value); Tcl_DStringInit(&buf); Tcl_DStringAppend(&buf, scalePtr->command, -1); Tcl_DStringAppend(&buf, " ", -1); Tcl_DStringAppend(&buf, string, -1); result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0); Tcl_DStringFree(&buf); if (result != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (command executed by scale)"); Tcl_BackgroundException(interp, result); } Tcl_Release(interp); } scalePtr->flags &= ~INVOKE_COMMAND; |
︙ | ︙ |