diff options
author | ericm <ericm> | 2000-10-01 21:35:27 (GMT) |
---|---|---|
committer | ericm <ericm> | 2000-10-01 21:35:27 (GMT) |
commit | 4d1295a615edc7e83ce11a59bc92224a8f5a437b (patch) | |
tree | 939e7789275241594beaa83157097ca1aa768f3e | |
parent | 5c06a2b6a522b05e7d208c8eb130ceed025357b5 (diff) | |
download | tk-4d1295a615edc7e83ce11a59bc92224a8f5a437b.zip tk-4d1295a615edc7e83ce11a59bc92224a8f5a437b.tar.gz tk-4d1295a615edc7e83ce11a59bc92224a8f5a437b.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 |