diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2003-08-14 12:30:11 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2003-08-14 12:30:11 (GMT) |
commit | a90b96e4f18ffa0acf1bdb7ea07c9c812bfbfd9e (patch) | |
tree | a0993c8ba95537dbcf5674ddc3d90f21971488ad /unix/tkUnixButton.c | |
parent | 6b8c41f861e35437ede8905963e5b5361abc9971 (diff) | |
download | tk-a90b96e4f18ffa0acf1bdb7ea07c9c812bfbfd9e.zip tk-a90b96e4f18ffa0acf1bdb7ea07c9c812bfbfd9e.tar.gz tk-a90b96e4f18ffa0acf1bdb7ea07c9c812bfbfd9e.tar.bz2 |
Make test suite pass without crashes from TIP#109 changes...
Diffstat (limited to 'unix/tkUnixButton.c')
-rw-r--r-- | unix/tkUnixButton.c | 22 |
1 files changed, 15 insertions, 7 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); } } |