summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bltGrLegd.C3
-rw-r--r--src/bltGraph.C12
2 files changed, 9 insertions, 6 deletions
diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C
index 81418ad..aad3cfd 100644
--- a/src/bltGrLegd.C
+++ b/src/bltGrLegd.C
@@ -589,7 +589,8 @@ CreateLegendWindow(Tcl_Interp *interp, Legend *legendPtr, const char *pathName)
if (tkwin == NULL) {
return TCL_ERROR;
}
- Blt_SetWindowInstanceData(tkwin, legendPtr);
+
+ ((TkWindow*)tkwin)->instanceData = legendPtr;
Tk_CreateEventHandler(tkwin, ExposureMask | StructureNotifyMask,
LegendEventProc, graphPtr);
/* Move the legend's binding table to the new window. */
diff --git a/src/bltGraph.C b/src/bltGraph.C
index 858bc81..72e076e 100644
--- a/src/bltGraph.C
+++ b/src/bltGraph.C
@@ -857,7 +857,8 @@ static Graph* CreateGraph(Tcl_Interp* interp, int objc, Tcl_Obj* const objv[],
Tk_SetClass(tkwin, "???");
break;
}
- Blt_SetWindowInstanceData(tkwin, graphPtr);
+
+ ((TkWindow*)tkwin)->instanceData = graphPtr;
if (InitPens(graphPtr) != TCL_OK)
goto error;
@@ -1542,13 +1543,14 @@ int Blt_GraphCmdInitProc(Tcl_Interp* interp)
Graph* Blt_GetGraphFromWindowData(Tk_Window tkwin)
{
while (tkwin) {
- Graph *graphPtr = (Graph*)Blt_GetWindowInstanceData(tkwin);
- if (graphPtr) {
- return graphPtr;
+ TkWindow* winPtr = (TkWindow*)tkwin;
+ if (winPtr->instanceData != NULL) {
+ Graph* graphPtr = (ClientData)winPtr->instanceData;
+ if (graphPtr)
+ return graphPtr;
}
tkwin = Tk_Parent(tkwin);
}
-
return NULL;
}