static int CheckbuttonConfigure(Tcl_Interp *interp, void *recordPtr, int mask) { Checkbutton *checkPtr = recordPtr; Ttk_TraceHandle *vt = Ttk_TraceVariable( interp, checkPtr->checkbutton.variableObj, CheckbuttonVariableChanged, checkPtr); if (!vt) { return TCL_ERROR; } if (BaseConfigure(interp, recordPtr, mask) != TCL_OK){ Ttk_UntraceVariable(vt); return TCL_ERROR; } Ttk_UntraceVariable(checkPtr->checkbutton.variableTrace); checkPtr->checkbutton.variableTrace = vt; return TCL_OK; }
/* ScaleConfigure -- * Configuration hook. */ static int ScaleConfigure(Tcl_Interp *interp, void *recordPtr, int mask) { Scale *scale = recordPtr; Tcl_Obj *varName = scale->scale.variableObj; Ttk_TraceHandle *vt = 0; if (varName != NULL && *Tcl_GetString(varName) != '\0') { vt = Ttk_TraceVariable(interp,varName, ScaleVariableChanged,recordPtr); if (!vt) return TCL_ERROR; } if (TtkCoreConfigure(interp, recordPtr, mask) != TCL_OK) { if (vt) Ttk_UntraceVariable(vt); return TCL_ERROR; } if (scale->scale.variableTrace) { Ttk_UntraceVariable(scale->scale.variableTrace); } scale->scale.variableTrace = vt; return TCL_OK; }