diff options
author | joye <joye> | 2014-03-06 22:47:47 (GMT) |
---|---|---|
committer | joye <joye> | 2014-03-06 22:47:47 (GMT) |
commit | 40c8eb39c51d169b7f31a49a0d7e39d87f4f666a (patch) | |
tree | f847abbd98f0e20036c0adaae7f5ee8b6beb2c99 /src | |
parent | 6ca66801c83e84be48c9b66c5adc4126631b65bb (diff) | |
download | blt-40c8eb39c51d169b7f31a49a0d7e39d87f4f666a.zip blt-40c8eb39c51d169b7f31a49a0d7e39d87f4f666a.tar.gz blt-40c8eb39c51d169b7f31a49a0d7e39d87f4f666a.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r-- | src/bltGrAxis.C | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C index 7bd27f4..5f3778b 100644 --- a/src/bltGrAxis.C +++ b/src/bltGrAxis.C @@ -563,28 +563,33 @@ static int CreateAxis(Tcl_Interp* interp, Graph* graphPtr, return TCL_ERROR; } + Axis* axisPtr; int isNew; Tcl_HashEntry* hPtr = Tcl_CreateHashEntry(&graphPtr->axes.table, string, &isNew); if (!isNew) { - Tcl_AppendResult(graphPtr->interp, "axis \"", string, - "\" already exists in \"", Tcl_GetString(objv[0]), - "\"", NULL); - return TCL_ERROR; + axisPtr = Tcl_GetHashValue(hPtr); + if ((axisPtr->flags & DELETE_PENDING) == 0) { + Tcl_AppendResult(graphPtr->interp, "axis \"", string, + "\" already exists in \"", Tcl_GetString(objv[0]), + "\"", NULL); + return TCL_ERROR; + } + axisPtr->flags &= ~DELETE_PENDING; + } + else { + axisPtr = NewAxis(graphPtr, Tcl_GetString(objv[3]), MARGIN_NONE); + if (!axisPtr) + return TCL_ERROR; + axisPtr->hashPtr = hPtr; + Tcl_SetHashValue(hPtr, axisPtr); } - - Axis* axisPtr = NewAxis(graphPtr, Tcl_GetString(objv[3]), MARGIN_NONE); - if (!axisPtr) - return TCL_ERROR; if ((Tk_InitOptions(graphPtr->interp, (char*)axisPtr, axisPtr->optionTable, graphPtr->tkwin) != TCL_OK) || (AxisObjConfigure(interp, axisPtr, objc-4, objv+4) != TCL_OK)) { DestroyAxis(axisPtr); return TCL_ERROR; } - axisPtr->hashPtr = hPtr; - Tcl_SetHashValue(hPtr, axisPtr); - graphPtr->flags |= CACHE_DIRTY; Blt_EventuallyRedrawGraph(graphPtr); |