diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-14 13:48:03 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-14 13:48:03 (GMT) |
commit | 0b9e60051d8b56808f7674686838055b264485f1 (patch) | |
tree | 94a7466233e7a73007acc61a138d2a1b04aafeca /generic | |
parent | 5da102f8bd2f7296a1786f951e0aedf27941ccb5 (diff) | |
download | tk-0b9e60051d8b56808f7674686838055b264485f1.zip tk-0b9e60051d8b56808f7674686838055b264485f1.tar.gz tk-0b9e60051d8b56808f7674686838055b264485f1.tar.bz2 |
Replace various functions calls, for functions which are small wrappers around other functions, to call the wrapped function directly.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkButton.c | 16 | ||||
-rw-r--r-- | generic/tkCmds.c | 4 | ||||
-rw-r--r-- | generic/tkEntry.c | 20 | ||||
-rw-r--r-- | generic/tkImgBmap.c | 4 | ||||
-rw-r--r-- | generic/tkImgPhInstance.c | 2 | ||||
-rw-r--r-- | generic/tkListbox.c | 8 | ||||
-rw-r--r-- | generic/tkMain.c | 2 | ||||
-rw-r--r-- | generic/tkMenu.c | 6 | ||||
-rw-r--r-- | generic/tkMenubutton.c | 12 | ||||
-rw-r--r-- | generic/tkMessage.c | 12 | ||||
-rw-r--r-- | generic/tkOldTest.c | 12 | ||||
-rw-r--r-- | generic/tkScale.c | 8 | ||||
-rw-r--r-- | generic/tkTest.c | 12 | ||||
-rw-r--r-- | generic/tkTextWind.c | 4 | ||||
-rw-r--r-- | generic/tkWindow.c | 6 | ||||
-rw-r--r-- | generic/ttk/ttkCache.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkEntry.c | 8 | ||||
-rw-r--r-- | generic/ttk/ttkScroll.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkTheme.c | 5 | ||||
-rw-r--r-- | generic/ttk/ttkTrace.c | 6 |
20 files changed, 77 insertions, 76 deletions
diff --git a/generic/tkButton.c b/generic/tkButton.c index e2c754e..73e5d4c 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -1297,13 +1297,13 @@ ConfigureButton( */ if (butPtr->textVarNamePtr != NULL) { - Tcl_TraceVar(interp, Tcl_GetString(butPtr->textVarNamePtr), - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + Tcl_TraceVar2(interp, Tcl_GetString(butPtr->textVarNamePtr), + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ButtonTextVarProc, butPtr); } if (butPtr->selVarNamePtr != NULL) { - Tcl_TraceVar(interp, Tcl_GetString(butPtr->selVarNamePtr), - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + Tcl_TraceVar2(interp, Tcl_GetString(butPtr->selVarNamePtr), + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ButtonVarProc, butPtr); } @@ -1618,8 +1618,8 @@ ButtonVarProc( if (flags & TCL_TRACE_UNSETS) { butPtr->flags &= ~(SELECTED | TRISTATED); if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { - Tcl_TraceVar(interp, Tcl_GetString(butPtr->selVarNamePtr), - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + Tcl_TraceVar2(interp, Tcl_GetString(butPtr->selVarNamePtr), + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ButtonVarProc, clientData); } goto redisplay; @@ -1712,8 +1712,8 @@ ButtonTextVarProc( if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { Tcl_ObjSetVar2(interp, butPtr->textVarNamePtr, NULL, butPtr->textPtr, TCL_GLOBAL_ONLY); - Tcl_TraceVar(interp, Tcl_GetString(butPtr->textVarNamePtr), - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + Tcl_TraceVar2(interp, Tcl_GetString(butPtr->textVarNamePtr), + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ButtonTextVarProc, clientData); } return NULL; diff --git a/generic/tkCmds.c b/generic/tkCmds.c index 4e9494b..1e260b5 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -1018,8 +1018,8 @@ Tk_TkwaitObjCmd( switch ((enum options) index) { case TKWAIT_VARIABLE: - if (Tcl_TraceVar(interp, Tcl_GetString(objv[2]), - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + if (Tcl_TraceVar2(interp, Tcl_GetString(objv[2]), + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, WaitVariableProc, &done) != TCL_OK) { return TCL_ERROR; } diff --git a/generic/tkEntry.c b/generic/tkEntry.c index d78f396..192101d 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1303,7 +1303,7 @@ ConfigureEntry( if (entryPtr->textVarName != NULL) { const char *value; - value = Tcl_GetVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY); + value = Tcl_GetVar2(interp, entryPtr->textVarName, NULL, TCL_GLOBAL_ONLY); if (value == NULL) { EntryValueChanged(entryPtr, NULL); } else { @@ -1357,8 +1357,8 @@ ConfigureEntry( if ((entryPtr->textVarName != NULL) && !(entryPtr->flags & ENTRY_VAR_TRACED)) { - Tcl_TraceVar(interp, entryPtr->textVarName, - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + Tcl_TraceVar2(interp, entryPtr->textVarName, + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, EntryTextVarProc, entryPtr); entryPtr->flags |= ENTRY_VAR_TRACED; } @@ -2231,8 +2231,8 @@ EntryValueChanged( if (entryPtr->textVarName == NULL) { newValue = NULL; } else { - newValue = Tcl_SetVar(entryPtr->interp, entryPtr->textVarName, - entryPtr->string, TCL_GLOBAL_ONLY); + newValue = Tcl_SetVar2(entryPtr->interp, entryPtr->textVarName, + NULL, entryPtr->string, TCL_GLOBAL_ONLY); } if ((newValue != NULL) && (strcmp(newValue, entryPtr->string) != 0)) { @@ -3095,9 +3095,9 @@ EntryTextVarProc( if (flags & TCL_TRACE_UNSETS) { if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { - Tcl_SetVar(interp, entryPtr->textVarName, entryPtr->string, - TCL_GLOBAL_ONLY); - Tcl_TraceVar(interp, entryPtr->textVarName, + Tcl_SetVar2(interp, entryPtr->textVarName, NULL, + entryPtr->string, TCL_GLOBAL_ONLY); + Tcl_TraceVar2(interp, entryPtr->textVarName, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, EntryTextVarProc, clientData); entryPtr->flags |= ENTRY_VAR_TRACED; @@ -3111,7 +3111,7 @@ EntryTextVarProc( * value because we changed it because someone typed in the entry). */ - value = Tcl_GetVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY); + value = Tcl_GetVar2(interp, entryPtr->textVarName, NULL, TCL_GLOBAL_ONLY); if (value == NULL) { value = ""; } @@ -3171,7 +3171,7 @@ EntryValidate( &bool) != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (invalid boolean result from validation command)"); - Tcl_BackgroundError(interp); + Tcl_BackgroundException(interp, TCL_ERROR); Tcl_ResetResult(interp); return TCL_ERROR; } diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index cdd57dd..bbc471e 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -330,7 +330,7 @@ ImgBmapConfigureMaster( * None. * * Side effects: - * Generates errors via Tcl_BackgroundError if there are problems in + * Generates errors via Tcl_BackgroundException if there are problems in * setting up the instance. * *---------------------------------------------------------------------- @@ -448,7 +448,7 @@ ImgBmapConfigureInstance( Tcl_AppendObjToErrorInfo(masterPtr->interp, Tcl_ObjPrintf( "\n (while configuring image \"%s\")", Tk_NameOfImage( masterPtr->tkMaster))); - Tcl_BackgroundError(masterPtr->interp); + Tcl_BackgroundException(masterPtr->interp, TCL_ERROR); } /* diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c index 3097489..01f11bb 100644 --- a/generic/tkImgPhInstance.c +++ b/generic/tkImgPhInstance.c @@ -64,7 +64,7 @@ static int imgPhotoColorHashInitialized; * None. * * Side effects: - * Generates errors via Tcl_BackgroundError if there are problems in + * Generates errors via Tcl_BackgroundException if there are problems in * setting up the instance. * *---------------------------------------------------------------------- diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 620f82f..178147d 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -1648,8 +1648,8 @@ ConfigureListbox( } listPtr->listObj = listVarObj; - Tcl_TraceVar(listPtr->interp, listPtr->listVarName, - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + Tcl_TraceVar2(listPtr->interp, listPtr->listVarName, + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ListboxListVarProc, listPtr); } else if (listPtr->listObj == NULL) { listPtr->listObj = Tcl_NewObj(); @@ -3381,8 +3381,8 @@ ListboxListVarProc( if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL, listPtr->listObj, TCL_GLOBAL_ONLY); - Tcl_TraceVar(interp, listPtr->listVarName, - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + Tcl_TraceVar2(interp, listPtr->listVarName, + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ListboxListVarProc, clientData); return NULL; } diff --git a/generic/tkMain.c b/generic/tkMain.c index 4d532df..6129548 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -335,7 +335,7 @@ Tk_MainEx( */ Tcl_AddErrorInfo(interp, ""); - TkpDisplayWarning(Tcl_GetVar(interp, "errorInfo", + TkpDisplayWarning(Tcl_GetVar2(interp, "errorInfo", NULL, TCL_GLOBAL_ONLY), "Error in startup script"); Tcl_DeleteInterp(interp); Tcl_Exit(1); diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 12d6ebd..391dfc1 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -1906,8 +1906,8 @@ PostProcessEntry( } if (mePtr->namePtr != NULL) { name = Tcl_GetString(mePtr->namePtr); - Tcl_TraceVar(menuPtr->interp, name, - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + Tcl_TraceVar2(menuPtr->interp, name, + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuVarProc, mePtr); } } @@ -2558,7 +2558,7 @@ MenuVarProc( * entry. */ - value = Tcl_GetVar(interp, name, TCL_GLOBAL_ONLY); + value = Tcl_GetVar2(interp, name, NULL, TCL_GLOBAL_ONLY); if (value == NULL) { value = ""; } diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 545401c..6f7869a 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -625,9 +625,9 @@ ConfigureMenuButton( */ const char *value; - value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY); + value = Tcl_GetVar2(interp, mbPtr->textVarName, NULL, TCL_GLOBAL_ONLY); if (value == NULL) { - Tcl_SetVar(interp, mbPtr->textVarName, mbPtr->text, + Tcl_SetVar2(interp, mbPtr->textVarName, NULL, mbPtr->text, TCL_GLOBAL_ONLY); } else { if (mbPtr->text != NULL) { @@ -636,7 +636,7 @@ ConfigureMenuButton( mbPtr->text = ckalloc(strlen(value) + 1); strcpy(mbPtr->text, value); } - Tcl_TraceVar(interp, mbPtr->textVarName, + Tcl_TraceVar2(interp, mbPtr->textVarName, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuButtonTextVarProc, mbPtr); } @@ -888,16 +888,16 @@ MenuButtonTextVarProc( if (flags & TCL_TRACE_UNSETS) { if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { - Tcl_SetVar(interp, mbPtr->textVarName, mbPtr->text, + Tcl_SetVar2(interp, mbPtr->textVarName, NULL, mbPtr->text, TCL_GLOBAL_ONLY); - Tcl_TraceVar(interp, mbPtr->textVarName, + Tcl_TraceVar2(interp, mbPtr->textVarName, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuButtonTextVarProc, clientData); } return NULL; } - value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY); + value = Tcl_GetVar2(interp, mbPtr->textVarName, NULL, TCL_GLOBAL_ONLY); if (value == NULL) { value = ""; } diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 4779e00..5d4ca60 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -470,9 +470,9 @@ ConfigureMessage( if (msgPtr->textVarName != NULL) { const char *value; - value = Tcl_GetVar(interp, msgPtr->textVarName, TCL_GLOBAL_ONLY); + value = Tcl_GetVar2(interp, msgPtr->textVarName, NULL, TCL_GLOBAL_ONLY); if (value == NULL) { - Tcl_SetVar(interp, msgPtr->textVarName, msgPtr->string, + Tcl_SetVar2(interp, msgPtr->textVarName, NULL, msgPtr->string, TCL_GLOBAL_ONLY); } else { if (msgPtr->string != NULL) { @@ -480,7 +480,7 @@ ConfigureMessage( } msgPtr->string = strcpy(ckalloc(strlen(value) + 1), value); } - Tcl_TraceVar(interp, msgPtr->textVarName, + Tcl_TraceVar2(interp, msgPtr->textVarName, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MessageTextVarProc, msgPtr); } @@ -845,16 +845,16 @@ MessageTextVarProc( if (flags & TCL_TRACE_UNSETS) { if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { - Tcl_SetVar(interp, msgPtr->textVarName, msgPtr->string, + Tcl_SetVar2(interp, msgPtr->textVarName, NULL, msgPtr->string, TCL_GLOBAL_ONLY); - Tcl_TraceVar(interp, msgPtr->textVarName, + Tcl_TraceVar2(interp, msgPtr->textVarName, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MessageTextVarProc, clientData); } return NULL; } - value = Tcl_GetVar(interp, msgPtr->textVarName, TCL_GLOBAL_ONLY); + value = Tcl_GetVar2(interp, msgPtr->textVarName, NULL, TCL_GLOBAL_ONLY); if (value == NULL) { value = ""; } diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c index b0edf76..2e931b1 100644 --- a/generic/tkOldTest.c +++ b/generic/tkOldTest.c @@ -268,7 +268,7 @@ ImageGet( XGCValues gcValues; sprintf(buffer, "%s get", timPtr->imageName); - Tcl_SetVar(timPtr->interp, timPtr->varName, buffer, + Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); instPtr = ckalloc(sizeof(TImageInstance)); @@ -315,8 +315,8 @@ ImageDisplay( sprintf(buffer, "%s display %d %d %d %d %d %d", instPtr->masterPtr->imageName, imageX, imageY, width, height, drawableX, drawableY); - Tcl_SetVar(instPtr->masterPtr->interp, instPtr->masterPtr->varName, buffer, - TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); + Tcl_SetVar2(instPtr->masterPtr->interp, instPtr->masterPtr->varName, NULL, + buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); if (width > (instPtr->masterPtr->width - imageX)) { width = instPtr->masterPtr->width - imageX; } @@ -358,8 +358,8 @@ ImageFree( char buffer[200]; sprintf(buffer, "%s free", instPtr->masterPtr->imageName); - Tcl_SetVar(instPtr->masterPtr->interp, instPtr->masterPtr->varName, buffer, - TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); + Tcl_SetVar2(instPtr->masterPtr->interp, instPtr->masterPtr->varName, NULL, + buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); Tk_FreeColor(instPtr->fg); Tk_FreeGC(display, instPtr->gc); ckfree(instPtr); @@ -392,7 +392,7 @@ ImageDelete( char buffer[100]; sprintf(buffer, "%s delete", timPtr->imageName); - Tcl_SetVar(timPtr->interp, timPtr->varName, buffer, + Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); Tcl_DeleteCommand(timPtr->interp, timPtr->imageName); diff --git a/generic/tkScale.c b/generic/tkScale.c index 3ca4a67..b27034f 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -677,8 +677,8 @@ ConfigureScale( ScaleSetVariable(scalePtr); } } - Tcl_TraceVar(interp, Tcl_GetString(scalePtr->varNamePtr), - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + Tcl_TraceVar2(interp, Tcl_GetString(scalePtr->varNamePtr), + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ScaleVarProc, scalePtr); } @@ -1180,8 +1180,8 @@ ScaleVarProc( if (flags & TCL_TRACE_UNSETS) { if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { - Tcl_TraceVar(interp, Tcl_GetString(scalePtr->varNamePtr), - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + Tcl_TraceVar2(interp, Tcl_GetString(scalePtr->varNamePtr), + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ScaleVarProc, clientData); scalePtr->flags |= NEVER_SET; TkScaleSetValue(scalePtr, scalePtr->value, 1, 0); diff --git a/generic/tkTest.c b/generic/tkTest.c index bd15739..c2d3ef9 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -1496,7 +1496,7 @@ ImageGet( XGCValues gcValues; sprintf(buffer, "%s get", timPtr->imageName); - Tcl_SetVar(timPtr->interp, timPtr->varName, buffer, + Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); instPtr = ckalloc(sizeof(TImageInstance)); @@ -1543,8 +1543,8 @@ ImageDisplay( sprintf(buffer, "%s display %d %d %d %d %d %d", instPtr->masterPtr->imageName, imageX, imageY, width, height, drawableX, drawableY); - Tcl_SetVar(instPtr->masterPtr->interp, instPtr->masterPtr->varName, buffer, - TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); + Tcl_SetVar2(instPtr->masterPtr->interp, instPtr->masterPtr->varName, NULL, + buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); if (width > (instPtr->masterPtr->width - imageX)) { width = instPtr->masterPtr->width - imageX; } @@ -1586,8 +1586,8 @@ ImageFree( char buffer[200]; sprintf(buffer, "%s free", instPtr->masterPtr->imageName); - Tcl_SetVar(instPtr->masterPtr->interp, instPtr->masterPtr->varName, buffer, - TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); + Tcl_SetVar2(instPtr->masterPtr->interp, instPtr->masterPtr->varName, NULL, + buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); Tk_FreeColor(instPtr->fg); Tk_FreeGC(display, instPtr->gc); ckfree(instPtr); @@ -1620,7 +1620,7 @@ ImageDelete( char buffer[100]; sprintf(buffer, "%s delete", timPtr->imageName); - Tcl_SetVar(timPtr->interp, timPtr->varName, buffer, + Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); Tcl_DeleteCommand(timPtr->interp, timPtr->imageName); diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index f258ec7..ad69004 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -927,7 +927,7 @@ EmbWinLayoutProc( Tcl_GetString(nameObj), textPtr->tkwin); Tcl_DecrRefCount(nameObj); if (ewPtr->body.ew.tkwin == NULL) { - Tcl_BackgroundError(textPtr->interp); + Tcl_BackgroundException(textPtr->interp, TCL_ERROR); goto gotWindow; } @@ -948,7 +948,7 @@ EmbWinLayoutProc( Tk_PathName(textPtr->tkwin))); Tcl_SetErrorCode(textPtr->interp, "TK", "GEOMETRY", "HIERARCHY", NULL); - Tcl_BackgroundError(textPtr->interp); + Tcl_BackgroundException(textPtr->interp, TCL_ERROR); ewPtr->body.ew.tkwin = NULL; goto gotWindow; } diff --git a/generic/tkWindow.c b/generic/tkWindow.c index f5131a8..db9b40f 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -993,8 +993,8 @@ TkCreateMainWindow( * Set variables for the intepreter. */ - Tcl_SetVar(interp, "tk_patchLevel", TK_PATCH_LEVEL, TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "tk_version", TK_VERSION, TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "tk_patchLevel", NULL, TK_PATCH_LEVEL, TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "tk_version", NULL, TK_VERSION, TCL_GLOBAL_ONLY); tsdPtr->numMainWindows++; return tkwin; @@ -3279,7 +3279,7 @@ Initialize( */ if (geometry != NULL) { - Tcl_SetVar(interp, "geometry", geometry, TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, "geometry", NULL, geometry, TCL_GLOBAL_ONLY); code = Tcl_VarEval(interp, "wm geometry . ", geometry, NULL); if (code != TCL_OK) { goto done; diff --git a/generic/ttk/ttkCache.c b/generic/ttk/ttkCache.c index 39c76e0..0ae2372 100644 --- a/generic/ttk/ttkCache.c +++ b/generic/ttk/ttkCache.c @@ -270,7 +270,7 @@ static Tcl_Obj *Ttk_Use( } else { Tcl_DecrRefCount(cacheObj); Tcl_SetHashValue(entryPtr, NULL); - Tcl_BackgroundError(interp); + Tcl_BackgroundException(interp, TCL_ERROR); return NULL; } } @@ -341,7 +341,7 @@ Tk_Image Ttk_UseImage(Ttk_ResourceCache cache, Tk_Window tkwin, Tcl_Obj *objPtr) Tcl_SetHashValue(entryPtr, image); if (!image) { - Tcl_BackgroundError(cache->interp); + Tcl_BackgroundException(cache->interp, TCL_ERROR); } return image; diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index a962662..9e99a5d 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -652,7 +652,7 @@ static void EntryRevalidateBG(Entry *entryPtr, VREASON reason) { Tcl_Interp *interp = entryPtr->core.interp; if (EntryRevalidate(interp, entryPtr, reason) == TCL_ERROR) { - Tcl_BackgroundError(interp); + Tcl_BackgroundException(interp, TCL_ERROR); } } @@ -758,8 +758,8 @@ static int EntrySetValue(Entry *entryPtr, const char *value) Tcl_GetString(entryPtr->entry.textVariableObj); if (textVarName && *textVarName) { entryPtr->core.flags |= SYNCING_VARIABLE; - value = Tcl_SetVar(entryPtr->core.interp, textVarName, - value, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); + value = Tcl_SetVar2(entryPtr->core.interp, textVarName, + NULL, value, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); entryPtr->core.flags &= ~SYNCING_VARIABLE; if (!value || WidgetDestroyed(&entryPtr->core)) { return TCL_ERROR; @@ -786,7 +786,7 @@ static void EntryTextVariableTrace(void *recordPtr, const char *value) } if (entryPtr->core.flags & SYNCING_VARIABLE) { - /* Trace was fired due to Tcl_SetVar call in EntrySetValue. + /* Trace was fired due to Tcl_SetVar2 call in EntrySetValue. * Don't do anything. */ return; diff --git a/generic/ttk/ttkScroll.c b/generic/ttk/ttkScroll.c index c02b868..f596bb4 100644 --- a/generic/ttk/ttkScroll.c +++ b/generic/ttk/ttkScroll.c @@ -124,7 +124,7 @@ static void UpdateScrollbarBG(ClientData clientData) Tcl_Preserve((ClientData) interp); code = UpdateScrollbar(interp, h); if (code == TCL_ERROR && !Tcl_InterpDeleted(interp)) { - Tcl_BackgroundError(interp); + Tcl_BackgroundException(interp, code); } Tcl_Release((ClientData) interp); } diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 6c2cab0..d102be2 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -508,8 +508,9 @@ static void ThemeChangedProc(ClientData clientData) static char ThemeChangedScript[] = "ttk::ThemeChanged"; StylePackageData *pkgPtr = clientData; - if (Tcl_EvalEx(pkgPtr->interp, ThemeChangedScript, -1, TCL_EVAL_GLOBAL) != TCL_OK) { - Tcl_BackgroundError(pkgPtr->interp); + int code = Tcl_EvalEx(pkgPtr->interp, ThemeChangedScript, -1, TCL_EVAL_GLOBAL); + if (code != TCL_OK) { + Tcl_BackgroundException(pkgPtr->interp, code); } pkgPtr->themeChangePending = 0; } diff --git a/generic/ttk/ttkTrace.c b/generic/ttk/ttkTrace.c index e6234b8..6cd6061 100644 --- a/generic/ttk/ttkTrace.c +++ b/generic/ttk/ttkTrace.c @@ -54,7 +54,7 @@ VarTraceProc( ckfree((ClientData)tracePtr); return NULL; } - Tcl_TraceVar(interp, name, + Tcl_TraceVar2(interp, name, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, VarTraceProc, clientData); tracePtr->callback(tracePtr->clientData, NULL); @@ -94,8 +94,8 @@ Ttk_TraceHandle *Ttk_TraceVariable( h->clientData = clientData; h->callback = callback; - status = Tcl_TraceVar(interp, Tcl_GetString(varnameObj), - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + status = Tcl_TraceVar2(interp, Tcl_GetString(varnameObj), + NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, VarTraceProc, (ClientData)h); if (status != TCL_OK) { |