summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2021-11-01 18:47:06 (GMT)
committermarc_culler <marc.culler@gmail.com>2021-11-01 18:47:06 (GMT)
commit06ca271c828bc7df25dfba6698246b15def3a28e (patch)
treef4d5b7d358b4d8eaafc2220bafa90e3f772bcc91 /generic
parent91132b91e16967b9558324c500fbbb724dbb47e1 (diff)
downloadtk-06ca271c828bc7df25dfba6698246b15def3a28e.zip
tk-06ca271c828bc7df25dfba6698246b15def3a28e.tar.gz
tk-06ca271c828bc7df25dfba6698246b15def3a28e.tar.bz2
Allow labels and buttons to have different default foreground colors if DEF_LABEL_FG is defined.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkButton.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/generic/tkButton.c b/generic/tkButton.c
index 4b04e9f..2c7d7d2 100644
--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -104,8 +104,13 @@ static const Tk_OptionSpec labelOptionSpecs[] = {
NULL, 0, -1, 0, "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0},
+#ifdef DEF_LABEL_FG
+ {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
+ DEF_LABEL_FG, -1, Tk_Offset(TkButton, normalFg), 0, 0, 0},
+#else
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
DEF_BUTTON_FG, -1, Tk_Offset(TkButton, normalFg), 0, 0, 0},
+#endif
{TK_OPTION_STRING, "-height", "height", "Height",
DEF_BUTTON_HEIGHT, Tk_Offset(TkButton, heightPtr), -1, 0, 0, 0},
{TK_OPTION_BORDER, "-highlightbackground", "highlightBackground",