summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixButton.c22
-rw-r--r--unix/tkUnixMenu.c9
2 files changed, 21 insertions, 10 deletions
diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c
index 4fb3b9e..e4f7fe7 100644
--- a/unix/tkUnixButton.c
+++ b/unix/tkUnixButton.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixButton.c,v 1.14 2003/08/14 10:31:14 dkf Exp $
+ * RCS: @(#) $Id: tkUnixButton.c,v 1.15 2003/08/14 12:30:11 dkf Exp $
*/
#include "tkButton.h"
@@ -599,23 +599,31 @@ TkpDisplayButton(clientData)
if ((butPtr->type == TYPE_CHECK_BUTTON) && butPtr->indicatorOn) {
if (butPtr->indicatorDiameter > 2*butPtr->borderWidth) {
TkBorder *selBorder = (TkBorder *) butPtr->selectBorder;
+ XColor *selColor = NULL;
+ if (selBorder != NULL) {
+ selColor = selBorder->bgColorPtr;
+ }
x -= butPtr->indicatorSpace/2;
y = Tk_Height(tkwin)/2;
- TkpDrawCheckIndicator(tkwin, butPtr->display, pixmap,
- x, y, border, butPtr->normalFg, selBorder->bgColorPtr,
- butPtr->disabledFg, (butPtr->flags & SELECTED),
+ TkpDrawCheckIndicator(tkwin, butPtr->display, pixmap, x, y,
+ border, butPtr->normalFg, selColor, butPtr->disabledFg,
+ (butPtr->flags & SELECTED),
(butPtr->state == STATE_DISABLED), CHECK_BUTTON);
}
} else if ((butPtr->type == TYPE_RADIO_BUTTON) && butPtr->indicatorOn) {
if (butPtr->indicatorDiameter > 2*butPtr->borderWidth) {
TkBorder *selBorder = (TkBorder *) butPtr->selectBorder;
+ XColor *selColor = NULL;
+ if (selBorder != NULL) {
+ selColor = selBorder->bgColorPtr;
+ }
x -= butPtr->indicatorSpace/2;
y = Tk_Height(tkwin)/2;
- TkpDrawCheckIndicator(tkwin, butPtr->display, pixmap,
- x, y, border, butPtr->normalFg, selBorder->bgColorPtr,
- butPtr->disabledFg, (butPtr->flags & SELECTED),
+ TkpDrawCheckIndicator(tkwin, butPtr->display, pixmap, x, y,
+ border, butPtr->normalFg, selColor, butPtr->disabledFg,
+ (butPtr->flags & SELECTED),
(butPtr->state == STATE_DISABLED), RADIO_BUTTON);
}
}
diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c
index 302edaf..1e6a682 100644
--- a/unix/tkUnixMenu.c
+++ b/unix/tkUnixMenu.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixMenu.c,v 1.8 2003/08/14 10:31:14 dkf Exp $
+ * RCS: @(#) $Id: tkUnixMenu.c,v 1.9 2003/08/14 12:30:11 dkf Exp $
*/
#include "tkPort.h"
@@ -1346,7 +1346,7 @@ TkpDrawMenuEntry(mePtr, d, tkfont, menuMetricsPtr, x, y, width, height,
{
GC gc, indicatorGC;
XColor *indicatorColor;
- XColor *disableColor;
+ XColor *disableColor = NULL;
TkMenu *menuPtr = mePtr->menuPtr;
Tk_3DBorder bgBorder, activeBorder;
CONST Tk_FontMetrics *fmPtr;
@@ -1409,7 +1409,10 @@ TkpDrawMenuEntry(mePtr, d, tkfont, menuMetricsPtr, x, y, width, height,
menuPtr->indicatorFgPtr);
}
- disableColor = Tk_GetColorFromObj(menuPtr->tkwin, menuPtr->disabledFgPtr);
+ if (menuPtr->disabledFgPtr != NULL) {
+ disableColor = Tk_GetColorFromObj(menuPtr->tkwin,
+ menuPtr->disabledFgPtr);
+ }
bgBorder = Tk_Get3DBorderFromObj(menuPtr->tkwin,
(mePtr->borderPtr == NULL)