diff options
author | ericm <ericm> | 2000-10-01 21:35:27 (GMT) |
---|---|---|
committer | ericm <ericm> | 2000-10-01 21:35:27 (GMT) |
commit | 6d28b3886a144880f15758a53ffe19d61fa09f33 (patch) | |
tree | 939e7789275241594beaa83157097ca1aa768f3e | |
parent | 40419579ce8cac5c28aa6658c95791a3ab8c64df (diff) | |
download | tk-6d28b3886a144880f15758a53ffe19d61fa09f33.zip tk-6d28b3886a144880f15758a53ffe19d61fa09f33.tar.gz tk-6d28b3886a144880f15758a53ffe19d61fa09f33.tar.bz2 |
* generic/tkButton.c (ConfigureButton): Added tests for -compound
option, so that when there is a textvariable and an image, and
-compound is not none, the button will display both the
textvariable and the image.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tkButton.c | 10 |
2 files changed, 12 insertions, 3 deletions
@@ -1,5 +1,10 @@ 2000-10-01 Eric Melski <ericm@ajubasolutions.com> + * generic/tkButton.c (ConfigureButton): Added tests for -compound + option, so that when there is a textvariable and an image, and + -compound is not none, the button will display both the + textvariable and the image. + * doc/SetOptions.3: Added note that restoreProc and freeProc may be NULL. diff --git a/generic/tkButton.c b/generic/tkButton.c index bc97641..ea2c10a 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.10 2000/08/23 19:18:19 hobbs Exp $ + * RCS: @(#) $Id: tkButton.c,v 1.11 2000/10/01 21:35:27 ericm Exp $ */ #include "tkButton.h" @@ -1028,7 +1028,7 @@ ConfigureButton(interp, butPtr, objc, objv) { Tk_SavedOptions savedOptions; Tcl_Obj *errorResult = NULL; - int error; + int error, haveImage; Tk_Image image; /* @@ -1169,7 +1169,11 @@ ConfigureButton(interp, butPtr, objc, objv) } butPtr->selectImage = image; - if ((butPtr->imagePtr == NULL) && (butPtr->bitmap == None) + haveImage = 0; + if (butPtr->imagePtr != NULL || butPtr->bitmap != None) { + haveImage = 1; + } + if ((!haveImage || butPtr->compound != COMPOUND_NONE) && (butPtr->textVarNamePtr != NULL)) { /* * The button must display the value of a variable: set up a trace |