summaryrefslogtreecommitdiff
blob: 4b98545eec837cb083d70fdc0636b4ce9c5cdeca (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
 src/ccp4mapwish_/c_src/ccp4mapwish_canvas.c | 34 ++++++++++++++---------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/ccp4mapwish_/c_src/ccp4mapwish_canvas.c b/src/ccp4mapwish_/c_src/ccp4mapwish_canvas.c
index 2c9f02f..98d814a 100755
--- a/src/ccp4mapwish_/c_src/ccp4mapwish_canvas.c
+++ b/src/ccp4mapwish_/c_src/ccp4mapwish_canvas.c
@@ -297,7 +297,7 @@ int canvas_draw_line(char *canvas, int npts, float *x, float *y, char *tags,
     puts("canvas_draw_line: about to evaluate the command...");
   }
   if (Tcl_Eval(interp,command) != TCL_OK) {
-    printf("canvas_draw_line: error from Tcl_Eval: %s",interp->result);
+    printf("canvas_draw_line: error from Tcl_Eval: %s",Tcl_GetStringResult(interp));
     return 0;
   }
   if (CCP4MAPWISH_CANVAS_DIAG)
@@ -432,7 +432,7 @@ int canvas_draw_rectangle(char *canvas, int npts, float *x, float *y,
     puts("canvas_draw_rectangle: about to evaluate the command...");
   }
   if (Tcl_Eval(interp,command) != TCL_OK) {
-    printf("canvas_draw_rectangle: error from Tcl_Eval: %s",interp->result);
+    printf("canvas_draw_rectangle: error from Tcl_Eval: %s",Tcl_GetStringResult(interp));
     printf("canvas_draw_rectangle:\ncanvas = \"%s\"\ntags = \"%s\"\ncolor = \"%s\"\nunits = \"%c\"\n",canvas,tags,color,units);
     return 0;
   }
@@ -536,7 +536,7 @@ int canvas_draw_label(char *canvas, char *text, float x, float y,
   /* Execute the command which draws the label */
   if (CCP4MAPWISH_CANVAS_DIAG) printf("canvas_draw_label: command is: %s\n",command);
   if (Tcl_Eval(interp,command) != TCL_OK) {
-    printf("canvas_draw_label: error from Tcl_Eval: %s\n",interp->result);
+    printf("canvas_draw_label: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
     return 0;
   }
 
@@ -617,7 +617,7 @@ int canvas_scale_canvas(char *canvas, char *tag, float scale)
   /* Execute the command which scales the canvas */
   if (CCP4MAPWISH_CANVAS_DIAG) printf("canvas_scale_canvas: command is: %s\n",command);
   if (Tcl_Eval(interp,command) != TCL_OK) {
-    printf("canvas_scale_canvas: error from Tcl_Eval: %s\n",interp->result);
+    printf("canvas_scale_canvas: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
     return 0;
   }
 
@@ -706,7 +706,7 @@ int canvas_shift_canvas(char *canvas)
   /* Execute the command which resizes the canvas */
   if (CCP4MAPWISH_CANVAS_DIAG) printf("canvas_shift_canvas: command is: %s\n",command);
   if (Tcl_Eval(interp,command) != TCL_OK) {
-    printf("canvas_shift_canvas: error from Tcl_Eval: %s\n",interp->result);
+    printf("canvas_shift_canvas: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
     return 0;
   }
 
@@ -789,7 +789,7 @@ int canvas_shift_element(char *canvas, char *tag, int shiftx, int shifty)
   /* Execute the command which resizes the canvas */
   if (CCP4MAPWISH_CANVAS_DIAG) printf("canvas_shift_canvas: command is: %s\n",command);
   if (Tcl_Eval(interp,command) != TCL_OK) {
-    printf("canvas_shift_element: error from Tcl_Eval: %s\n",interp->result);
+    printf("canvas_shift_element: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
     return 0;
   }
 
@@ -861,7 +861,7 @@ int canvas_delete(char *canvas, char *tag)
   /* Execute the command which deletes the tagged items */
   if (CCP4MAPWISH_CANVAS_DIAG) printf("canvas_delete: command is: %s\n",command);
   if (Tcl_Eval(interp,command) != TCL_OK) {
-    printf("canvas_scale_canvas: error from Tcl_Eval: %s\n",interp->result);
+    printf("canvas_scale_canvas: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
     return 0;
   }
 
@@ -892,15 +892,15 @@ int canvas_exists(char *canvas)
 
   sprintf(tmpstr,"winfo exists %s",canvas);
   if (Tcl_Eval(interp,tmpstr) != TCL_OK) {
-    printf("canvas_exists: error from Tcl_Eval: %s",interp->result);
+    printf("canvas_exists: error from Tcl_Eval: %s",Tcl_GetStringResult(interp));
     return 0;
   }
   /* Extract a long int using strtol
      If no conversion takes place then "endptr" will be equal
      to "result" */
-  istatus = (int) strtol(interp->result,&endptr,10);
-  if (strcmp(interp->result,endptr) == 0) {
-    printf("canvas_exists: bad return status from winfo command \"%s\"\n",interp->result);
+  istatus = (int) strtol(Tcl_GetStringResult(interp),&endptr,10);
+  if (strcmp(Tcl_GetStringResult(interp),endptr) == 0) {
+    printf("canvas_exists: bad return status from winfo command \"%s\"\n",Tcl_GetStringResult(interp));
     return 0;
   }
   if (!istatus) {
@@ -930,13 +930,13 @@ float canvas_get_tk_scaling(char *canvas, char units)
 
   /* Execute the tk scaling command */
   if (Tcl_Eval(interp,"tk scaling") != TCL_OK) {
-    printf("canvas_get_tk_scaling: error from Tcl_Eval: %s",interp->result);
+    printf("canvas_get_tk_scaling: error from Tcl_Eval: %s",Tcl_GetStringResult(interp));
     return (float) 0.0;
   }
 
   /* Extract a float from the result */
-  tkscale = ((float) strtod(interp->result,&endptr));
-  if (strcmp(interp->result,endptr) == 0) {
+  tkscale = ((float) strtod(Tcl_GetStringResult(interp),&endptr));
+  if (strcmp(Tcl_GetStringResult(interp),endptr) == 0) {
     printf("canvas_get_tk_scaling: couldn't extract scale factor\n");
     return (float) 0.0;
   }
@@ -1021,19 +1021,19 @@ int canvas_get_limits(char *canvas, int limits[4])
 
   /* Evaluate the command */
   if (Tcl_Eval(interp,command) != TCL_OK) {
-    printf("canvas_get_limits: error from Tcl_Eval: %s\n",interp->result);
+    printf("canvas_get_limits: error from Tcl_Eval: %s\n",Tcl_GetStringResult(interp));
     return 0;
   }
 
   /* Process the result - it should consist of 4 integers */
   /* Use strtok which can split the string based on tokens
      set by the programmer - in this case a space */
-  if (!interp->result) {
+  if (!Tcl_GetStringResult(interp)) {
     puts("canvas_get_limits: failed to fetch canvas limits");
     return TCL_ERROR;
   }
   i = 0;
-  p = strtok(interp->result," ");
+  p = strtok(Tcl_GetStringResult(interp)," ");
   if (p == NULL) {
     return 0;
   }