Import Tk 8.6.11

This commit is contained in:
Steve Dower
2021-03-30 00:54:10 +01:00
parent 42c69189d9
commit 070b8750b0
403 changed files with 21608 additions and 16269 deletions

View File

@@ -3,11 +3,11 @@
*
* Simplified interface to Tcl_TraceVariable.
*
* PROBLEM: Can't distinguish "variable does not exist" (which is OK)
* PROBLEM: Can't distinguish "variable does not exist" (which is OK)
* from other errors (which are not).
*/
#include <tk.h>
#include "tkInt.h"
#include "ttkTheme.h"
#include "ttkWidget.h"
@@ -30,9 +30,11 @@ VarTraceProc(
const char *name2, /* (unused) */
int flags) /* Information about what happened. */
{
Ttk_TraceHandle *tracePtr = clientData;
Ttk_TraceHandle *tracePtr = (Ttk_TraceHandle *)clientData;
const char *name, *value;
Tcl_Obj *valuePtr;
(void)name1;
(void)name2;
if (Tcl_InterpDeleted(interp)) {
return NULL;
@@ -51,7 +53,7 @@ VarTraceProc(
*/
if (tracePtr->interp == NULL) {
Tcl_DecrRefCount(tracePtr->varnameObj);
ckfree((ClientData)tracePtr);
ckfree(tracePtr);
return NULL;
}
Tcl_TraceVar2(interp, name, NULL,
@@ -85,7 +87,7 @@ Ttk_TraceHandle *Ttk_TraceVariable(
Ttk_TraceProc callback,
void *clientData)
{
Ttk_TraceHandle *h = ckalloc(sizeof(*h));
Ttk_TraceHandle *h = (Ttk_TraceHandle *)ckalloc(sizeof(*h));
int status;
h->interp = interp;
@@ -96,7 +98,7 @@ Ttk_TraceHandle *Ttk_TraceVariable(
status = Tcl_TraceVar2(interp, Tcl_GetString(varnameObj),
NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
VarTraceProc, (ClientData)h);
VarTraceProc, h);
if (status != TCL_OK) {
Tcl_DecrRefCount(h->varnameObj);
@@ -137,7 +139,7 @@ void Ttk_UntraceVariable(Ttk_TraceHandle *h)
*/
while ((cd = Tcl_VarTraceInfo(h->interp, Tcl_GetString(h->varnameObj),
TCL_GLOBAL_ONLY, VarTraceProc, cd)) != NULL) {
if (cd == (ClientData) h) {
if (cd == h) {
break;
}
}
@@ -152,7 +154,7 @@ void Ttk_UntraceVariable(Ttk_TraceHandle *h)
}
Tcl_UntraceVar2(h->interp, Tcl_GetString(h->varnameObj),
NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
VarTraceProc, (ClientData)h);
VarTraceProc, h);
Tcl_DecrRefCount(h->varnameObj);
ckfree(h);
}