diff options
author | stanton <stanton> | 1998-11-30 21:03:40 (GMT) |
---|---|---|
committer | stanton <stanton> | 1998-11-30 21:03:40 (GMT) |
commit | d66af4849672c4e91f0b0732939883c70693c9dd (patch) | |
tree | 578d87e6bcb9fa4c73fe08ef2e7f6e4db8ee9bfa | |
parent | d8926483fbc1aa54f39f2772c0b355751c10ce44 (diff) | |
download | tk-d66af4849672c4e91f0b0732939883c70693c9dd.zip tk-d66af4849672c4e91f0b0732939883c70693c9dd.tar.gz tk-d66af4849672c4e91f0b0732939883c70693c9dd.tar.bz2 |
* generic/tkButton.c (ConfigureButton): The error result was
getting lost when restoring configuration options. [Bug: 619]
-rw-r--r-- | generic/tkButton.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/generic/tkButton.c b/generic/tkButton.c index 02c0a6f..7b10023 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkButton.c,v 1.1.4.2 1998/09/30 02:16:40 stanton Exp $ + * RCS: @(#) $Id: tkButton.c,v 1.1.4.3 1998/11/30 21:03:40 stanton Exp $ */ #include "tkButton.h" @@ -983,6 +983,7 @@ ConfigureButton(interp, butPtr, objc, objv) Tcl_Obj *CONST objv[]; /* Argument values. */ { Tk_SavedOptions savedOptions; + Tcl_Obj *errorResult; int error; Tk_Image image; @@ -1024,6 +1025,8 @@ ConfigureButton(interp, butPtr, objc, objv) * Second pass: restore options to old values. */ + errorResult = Tcl_GetObjResult(interp); + Tcl_IncrRefCount(errorResult); Tk_RestoreSavedOptions(&savedOptions); } @@ -1205,7 +1208,13 @@ ConfigureButton(interp, butPtr, objc, objv) } TkButtonWorldChanged((ClientData) butPtr); - return (error) ? TCL_ERROR : TCL_OK; + if (error) { + Tcl_SetObjResult(interp, errorResult); + Tcl_DecrRefCount(errorResult); + return TCL_ERROR; + } else { + return TCL_OK; + } } /* |