diff options
author | marc_culler <marc.culler@gmail.com> | 2021-11-01 18:47:06 (GMT) |
---|---|---|
committer | marc_culler <marc.culler@gmail.com> | 2021-11-01 18:47:06 (GMT) |
commit | 06ca271c828bc7df25dfba6698246b15def3a28e (patch) | |
tree | f4d5b7d358b4d8eaafc2220bafa90e3f772bcc91 | |
parent | 91132b91e16967b9558324c500fbbb724dbb47e1 (diff) | |
download | tk-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.
-rw-r--r-- | generic/tkButton.c | 5 | ||||
-rw-r--r-- | macosx/tkMacOSXDefault.h | 1 |
2 files changed, 6 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", diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index e327b77..d7dbf8d 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -69,6 +69,7 @@ #define DEF_BUTTON_DISABLED_FG_COLOR DISABLED #define DEF_BUTTON_DISABLED_FG_MONO "" #define DEF_BUTTON_FG BLACK +#define DEF_LABEL_FG NORMAL_FG #define DEF_CHKRAD_FG DEF_BUTTON_FG #define DEF_BUTTON_FONT "TkDefaultFont" #define DEF_BUTTON_HEIGHT "0" |