aboutsummaryrefslogtreecommitdiff
path: root/graphics/tclblt/patches/tk8.6.patch
blob: 3de6c0ed158a62e2d43d465c3bd9625805e7d2e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Description: Patch replaces call to TkCopyAndGlobalEval by a call to
    Tcl_EvalObjEx because the former function has been dropped in Tk 8.6.
Last-Modified: Fri, 04 Jul 2014 09:18:32 +0400

--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -864,8 +864,6 @@
 static Blt_TileChangedProc TileChangedProc;
 static Tcl_CmdProc ButtonCmd, LabelCmd, CheckbuttonCmd, RadiobuttonCmd;
 
-EXTERN int TkCopyAndGlobalEval _ANSI_ARGS_((Tcl_Interp *interp, char *script));
-
 #if (TK_MAJOR_VERSION > 4)
 EXTERN void TkComputeAnchor _ANSI_ARGS_((Tk_Anchor anchor, Tk_Window tkwin, 
 	int padX, int padY, int innerWidth, int innerHeight, int *xPtr, 
@@ -3292,7 +3290,12 @@
 	}
     }
     if ((butPtr->type > TYPE_LABEL) && (butPtr->command != NULL)) {
-	return TkCopyAndGlobalEval(butPtr->interp, butPtr->command);
+	Tcl_DString buf;
+	Tcl_DStringInit(&buf);
+	Tcl_DStringAppend(&buf, butPtr->command, -1);
+	int code = Tcl_EvalEx(butPtr->interp, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf), TCL_EVAL_GLOBAL);
+	Tcl_DStringFree(&buf);
+	return code;
     }
     return TCL_OK;
 }