From d66af4849672c4e91f0b0732939883c70693c9dd Mon Sep 17 00:00:00 2001 From: stanton Date: Mon, 30 Nov 1998 21:03:40 +0000 Subject: * generic/tkButton.c (ConfigureButton): The error result was getting lost when restoring configuration options. [Bug: 619] --- generic/tkButton.c | 13 +++++++++++-- 1 file 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; + } } /* -- cgit v0.12