diff options
author | joye <joye> | 2014-02-07 18:36:39 (GMT) |
---|---|---|
committer | joye <joye> | 2014-02-07 18:36:39 (GMT) |
commit | 34336cdf94180cdd203a1efceef60222bbdbcfee (patch) | |
tree | f5404ee418de16a5d202bdad133f158227d88edf /src | |
parent | 1518ea3fe0237dca94a4c6c247489cef35e6e935 (diff) | |
download | blt-34336cdf94180cdd203a1efceef60222bbdbcfee.zip blt-34336cdf94180cdd203a1efceef60222bbdbcfee.tar.gz blt-34336cdf94180cdd203a1efceef60222bbdbcfee.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r-- | src/bltGraph.C | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/src/bltGraph.C b/src/bltGraph.C index 36580fd..1753129 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -446,15 +446,33 @@ int Blt_GraphInstCmdProc(ClientData clientData, Tcl_Interp* interp, int objc, Graph* graphPtr = clientData; GraphCmdProc* proc = Blt_GetOpFromObj(interp, nGraphOps, graphOps, BLT_OP_ARG1, objc, objv, 0); - if (proc == NULL) { + if (proc == NULL) return TCL_ERROR; - } + Tcl_Preserve(graphPtr); int result = (*proc) (graphPtr, interp, objc, objv); Tcl_Release(graphPtr); return result; } +static int CgetOp(Graph* graphPtr, Tcl_Interp* interp, int objc, + Tcl_Obj* const objv[]) +{ + if (objc != 3) { + Tcl_WrongNumArgs(interp, 1, objv, "cget option"); + return TCL_ERROR; + } + Tcl_Obj* objPtr = Tk_GetOptionValue(interp, (char*)graphPtr, + graphPtr->optionTable, + (objc == 3) ? objv[2] : NULL, + graphPtr->tkwin); + if (objPtr == NULL) + return TCL_ERROR; + else + Tcl_SetObjResult(interp, objPtr); + return TCL_OK; +} + static int ConfigureOp(Graph* graphPtr, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]) { @@ -463,29 +481,14 @@ static int ConfigureOp(Graph* graphPtr, Tcl_Interp* interp, int objc, graphPtr->optionTable, (objc == 3) ? objv[2] : NULL, graphPtr->tkwin); - if (!objPtr) + if (objPtr == NULL) return TCL_ERROR; else Tcl_SetObjResult(interp, objPtr); - } else { - if (GraphObjConfigure(interp, graphPtr, objc-2, objv+2) != TCL_OK) - return TCL_ERROR; - } - return TCL_OK; -} - -static int CgetOp(Graph* graphPtr, Tcl_Interp* interp, int objc, - Tcl_Obj* const objv[]) -{ - Tcl_Obj* objPtr = Tk_GetOptionValue(interp, (char*)graphPtr, - graphPtr->optionTable, - (objc == 3) ? objv[2] : NULL, - graphPtr->tkwin); - if (!objPtr) - return TCL_ERROR; + return TCL_OK; + } else - Tcl_SetObjResult(interp, objPtr); - return TCL_OK; + return GraphObjConfigure(interp, graphPtr, objc-2, objv+2); } static int GraphObjConfigure(Tcl_Interp* interp, Graph* graphPtr, |