summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkButton.c8
-rw-r--r--generic/tkInt.h1
-rw-r--r--generic/tkMenu.c2
-rw-r--r--generic/tkMenubutton.c3
-rw-r--r--macosx/tkMacOSXDefault.h3
-rw-r--r--unix/tkUnixDefault.h3
-rw-r--r--win/tkWinDefault.h3
7 files changed, 7 insertions, 16 deletions
diff --git a/generic/tkButton.c b/generic/tkButton.c
index 04c9d78..03496bb 100644
--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -144,7 +144,7 @@ static const Tk_OptionSpec labelOptionSpecs[] = {
DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_INT, "-underline", "underline", "Underline",
- DEF_BUTTON_UNDERLINE, TCL_INDEX_NONE, offsetof(TkButton, underline), 0, 0, 0},
+ TK_OPTION_UNDERLINE_DEF(TkButton, underline), 0},
{TK_OPTION_STRING, "-width", "width", "Width",
DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_INDEX_NONE, 0, 0, 0},
{TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength",
@@ -245,7 +245,7 @@ static const Tk_OptionSpec buttonOptionSpecs[] = {
DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_INT, "-underline", "underline", "Underline",
- DEF_BUTTON_UNDERLINE, TCL_INDEX_NONE, offsetof(TkButton, underline), 0, 0, 0},
+ TK_OPTION_UNDERLINE_DEF(TkButton, underline), 0},
{TK_OPTION_STRING, "-width", "width", "Width",
DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_INDEX_NONE, 0, 0, 0},
{TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength",
@@ -355,7 +355,7 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = {
{TK_OPTION_STRING, "-tristatevalue", "tristateValue", "TristateValue",
DEF_BUTTON_TRISTATE_VALUE, offsetof(TkButton, tristateValuePtr), TCL_INDEX_NONE, 0, 0, 0},
{TK_OPTION_INT, "-underline", "underline", "Underline",
- DEF_BUTTON_UNDERLINE, TCL_INDEX_NONE, offsetof(TkButton, underline), 0, 0, 0},
+ TK_OPTION_UNDERLINE_DEF(TkButton, underline), 0},
{TK_OPTION_STRING, "-variable", "variable", "Variable",
DEF_CHECKBUTTON_VARIABLE, offsetof(TkButton, selVarNamePtr), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
@@ -465,7 +465,7 @@ static const Tk_OptionSpec radiobuttonOptionSpecs[] = {
{TK_OPTION_STRING, "-tristatevalue", "tristateValue", "TristateValue",
DEF_BUTTON_TRISTATE_VALUE, offsetof(TkButton, tristateValuePtr), TCL_INDEX_NONE, 0, 0, 0},
{TK_OPTION_INT, "-underline", "underline", "Underline",
- DEF_BUTTON_UNDERLINE, TCL_INDEX_NONE, offsetof(TkButton, underline), 0, 0, 0},
+ TK_OPTION_UNDERLINE_DEF(TkButton, underline), 0},
{TK_OPTION_STRING, "-value", "value", "Value",
DEF_BUTTON_VALUE, offsetof(TkButton, onValuePtr), TCL_INDEX_NONE, 0, 0, 0},
{TK_OPTION_STRING, "-variable", "variable", "Variable",
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 68838b7..cc29660 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -1378,6 +1378,7 @@ MODULE_SCOPE void TkRotatePoint(double originX, double originY,
MODULE_SCOPE int TkGetIntForIndex(Tcl_Obj *, TkSizeT, int lastOK, TkSizeT*);
#define TkNewIndexObj(value) Tcl_NewWideIntObj((Tcl_WideInt)(value + 1) - 1)
+#define TK_OPTION_UNDERLINE_DEF(type, field) "-1", TCL_INDEX_NONE, offsetof(type, field), 0, NULL
#ifdef _WIN32
#define TkParseColor XParseColor
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index a7e6363..da5815f 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -161,7 +161,7 @@ static const Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = {
TCL_INDEX_NONE, offsetof(TkMenuEntry, state), 0,
(ClientData) menuStateStrings, 0},
{TK_OPTION_INT, "-underline", NULL, NULL,
- DEF_MENU_ENTRY_UNDERLINE, TCL_INDEX_NONE, offsetof(TkMenuEntry, underline), 0, NULL, 0},
+ TK_OPTION_UNDERLINE_DEF(TkMenuEntry, underline), 0},
{TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0}
};
diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c
index dbf6208..ede28dd 100644
--- a/generic/tkMenubutton.c
+++ b/generic/tkMenubutton.c
@@ -145,8 +145,7 @@ static const Tk_OptionSpec optionSpecs[] = {
DEF_MENUBUTTON_TEXT_VARIABLE, TCL_INDEX_NONE,
offsetof(TkMenuButton, textVarName), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_INT, "-underline", "underline", "Underline",
- DEF_MENUBUTTON_UNDERLINE, TCL_INDEX_NONE, offsetof(TkMenuButton, underline),
- 0, 0, 0},
+ TK_OPTION_UNDERLINE_DEF(TkMenuButton, underline), 0},
{TK_OPTION_STRING, "-width", "width", "Width",
DEF_MENUBUTTON_WIDTH, TCL_INDEX_NONE, offsetof(TkMenuButton, widthString),
0, 0, 0},
diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h
index 1df20f7..fb1292d 100644
--- a/macosx/tkMacOSXDefault.h
+++ b/macosx/tkMacOSXDefault.h
@@ -105,7 +105,6 @@
#define DEF_BUTTON_TAKE_FOCUS NULL
#define DEF_BUTTON_TEXT ""
#define DEF_BUTTON_TEXT_VARIABLE ""
-#define DEF_BUTTON_UNDERLINE "-1"
#define DEF_BUTTON_VALUE ""
#define DEF_BUTTON_WIDTH "0"
#define DEF_BUTTON_WRAP_LENGTH "0"
@@ -296,7 +295,6 @@
#define DEF_MENU_ENTRY_CHECK_VARIABLE NULL
#define DEF_MENU_ENTRY_RADIO_VARIABLE "selectedButton"
#define DEF_MENU_ENTRY_SELECT NULL
-#define DEF_MENU_ENTRY_UNDERLINE "-1"
/*
* Defaults for menus overall:
@@ -361,7 +359,6 @@
#define DEF_MENUBUTTON_TAKE_FOCUS "0"
#define DEF_MENUBUTTON_TEXT ""
#define DEF_MENUBUTTON_TEXT_VARIABLE ""
-#define DEF_MENUBUTTON_UNDERLINE "-1"
#define DEF_MENUBUTTON_WIDTH "0"
#define DEF_MENUBUTTON_WRAP_LENGTH "0"
diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h
index b59f7ae..3cae17b 100644
--- a/unix/tkUnixDefault.h
+++ b/unix/tkUnixDefault.h
@@ -88,7 +88,6 @@
#define DEF_BUTTON_TAKE_FOCUS NULL
#define DEF_BUTTON_TEXT ""
#define DEF_BUTTON_TEXT_VARIABLE ""
-#define DEF_BUTTON_UNDERLINE "-1"
#define DEF_BUTTON_VALUE ""
#define DEF_BUTTON_WIDTH "0"
#define DEF_BUTTON_WRAP_LENGTH "0"
@@ -268,7 +267,6 @@
#define DEF_MENU_ENTRY_CHECK_VARIABLE NULL
#define DEF_MENU_ENTRY_RADIO_VARIABLE "selectedButton"
#define DEF_MENU_ENTRY_SELECT NULL
-#define DEF_MENU_ENTRY_UNDERLINE "-1"
/*
* Defaults for menus overall:
@@ -333,7 +331,6 @@
#define DEF_MENUBUTTON_TAKE_FOCUS "0"
#define DEF_MENUBUTTON_TEXT ""
#define DEF_MENUBUTTON_TEXT_VARIABLE ""
-#define DEF_MENUBUTTON_UNDERLINE "-1"
#define DEF_MENUBUTTON_WIDTH "0"
#define DEF_MENUBUTTON_WRAP_LENGTH "0"
diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h
index eaceb42..0a747d9 100644
--- a/win/tkWinDefault.h
+++ b/win/tkWinDefault.h
@@ -91,7 +91,6 @@
#define DEF_BUTTON_TEXT ""
#define DEF_BUTTON_TEXT_VARIABLE ""
#define DEF_BUTTON_TRISTATE_VALUE ""
-#define DEF_BUTTON_UNDERLINE "-1"
#define DEF_BUTTON_VALUE ""
#define DEF_BUTTON_WIDTH "0"
#define DEF_BUTTON_WRAP_LENGTH "0"
@@ -270,7 +269,6 @@
#define DEF_MENU_ENTRY_CHECK_VARIABLE NULL
#define DEF_MENU_ENTRY_RADIO_VARIABLE "selectedButton"
#define DEF_MENU_ENTRY_SELECT NULL
-#define DEF_MENU_ENTRY_UNDERLINE "-1"
/*
* Defaults for menus overall:
@@ -335,7 +333,6 @@
#define DEF_MENUBUTTON_TAKE_FOCUS "0"
#define DEF_MENUBUTTON_TEXT ""
#define DEF_MENUBUTTON_TEXT_VARIABLE ""
-#define DEF_MENUBUTTON_UNDERLINE "-1"
#define DEF_MENUBUTTON_WIDTH "0"
#define DEF_MENUBUTTON_WRAP_LENGTH "0"