summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorericm <ericm>2000-10-01 21:35:27 (GMT)
committerericm <ericm>2000-10-01 21:35:27 (GMT)
commit4d1295a615edc7e83ce11a59bc92224a8f5a437b (patch)
tree939e7789275241594beaa83157097ca1aa768f3e
parent5c06a2b6a522b05e7d208c8eb130ceed025357b5 (diff)
downloadtk-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--ChangeLog5
-rw-r--r--generic/tkButton.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 761dcfc..37eaa3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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