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/ttk | |
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/ttk')
-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 |
5 files changed, 13 insertions, 12 deletions
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) { |