summaryrefslogtreecommitdiffstats
path: root/generic/tkMenu.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-22 12:43:28 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-22 12:43:28 (GMT)
commitdfb0c81cd0a5d7f83c551496fdce521a68f12ffe (patch)
tree3d74c78e6c256fc20997d7340ff7f8e07f4306bb /generic/tkMenu.c
parent418047d43e5fde9bc3489580cc881324f5f3da7d (diff)
downloadtk-dfb0c81cd0a5d7f83c551496fdce521a68f12ffe.zip
tk-dfb0c81cd0a5d7f83c551496fdce521a68f12ffe.tar.gz
tk-dfb0c81cd0a5d7f83c551496fdce521a68f12ffe.tar.bz2
Don't use TCL_AUTO_LENGTH in Tk any more, just use TCL_INDEX_NONE consistantly everywhere: It's actually the same.
Diffstat (limited to 'generic/tkMenu.c')
-rw-r--r--generic/tkMenu.c108
1 files changed, 54 insertions, 54 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 33acc37..3b50daa 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -118,117 +118,117 @@ static const char *const compoundStrings[] = {
static const Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", NULL, NULL,
- DEF_MENU_ENTRY_ACTIVE_BG, offsetof(TkMenuEntry, activeBorderPtr), TCL_AUTO_LENGTH,
+ DEF_MENU_ENTRY_ACTIVE_BG, offsetof(TkMenuEntry, activeBorderPtr), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_COLOR, "-activeforeground", NULL, NULL,
DEF_MENU_ENTRY_ACTIVE_FG,
- offsetof(TkMenuEntry, activeFgPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, activeFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-accelerator", NULL, NULL,
DEF_MENU_ENTRY_ACCELERATOR,
- offsetof(TkMenuEntry, accelPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, accelPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BORDER, "-background", NULL, NULL,
DEF_MENU_ENTRY_BG,
- offsetof(TkMenuEntry, borderPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, borderPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BITMAP, "-bitmap", NULL, NULL,
DEF_MENU_ENTRY_BITMAP,
- offsetof(TkMenuEntry, bitmapPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, bitmapPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BOOLEAN, "-columnbreak", NULL, NULL,
DEF_MENU_ENTRY_COLUMN_BREAK,
- TCL_AUTO_LENGTH, offsetof(TkMenuEntry, columnBreak), 0, NULL, 0},
+ TCL_INDEX_NONE, offsetof(TkMenuEntry, columnBreak), 0, NULL, 0},
{TK_OPTION_STRING, "-command", NULL, NULL,
DEF_MENU_ENTRY_COMMAND,
- offsetof(TkMenuEntry, commandPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, commandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
- DEF_MENU_ENTRY_COMPOUND, TCL_AUTO_LENGTH, offsetof(TkMenuEntry, compound), 0,
+ DEF_MENU_ENTRY_COMPOUND, TCL_INDEX_NONE, offsetof(TkMenuEntry, compound), 0,
(ClientData) compoundStrings, 0},
{TK_OPTION_FONT, "-font", NULL, NULL,
DEF_MENU_ENTRY_FONT,
- offsetof(TkMenuEntry, fontPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, fontPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_COLOR, "-foreground", NULL, NULL,
DEF_MENU_ENTRY_FG,
- offsetof(TkMenuEntry, fgPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, fgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BOOLEAN, "-hidemargin", NULL, NULL,
DEF_MENU_ENTRY_HIDE_MARGIN,
- TCL_AUTO_LENGTH, offsetof(TkMenuEntry, hideMargin), 0, NULL, 0},
+ TCL_INDEX_NONE, offsetof(TkMenuEntry, hideMargin), 0, NULL, 0},
{TK_OPTION_STRING, "-image", NULL, NULL,
DEF_MENU_ENTRY_IMAGE,
- offsetof(TkMenuEntry, imagePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, imagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-label", NULL, NULL,
DEF_MENU_ENTRY_LABEL,
- offsetof(TkMenuEntry, labelPtr), TCL_AUTO_LENGTH, 0, NULL, 0},
+ offsetof(TkMenuEntry, labelPtr), TCL_INDEX_NONE, 0, NULL, 0},
{TK_OPTION_STRING_TABLE, "-state", NULL, NULL,
DEF_MENU_ENTRY_STATE,
- TCL_AUTO_LENGTH, offsetof(TkMenuEntry, state), 0,
+ TCL_INDEX_NONE, offsetof(TkMenuEntry, state), 0,
(ClientData) menuStateStrings, 0},
{TK_OPTION_INT, "-underline", NULL, NULL,
- DEF_MENU_ENTRY_UNDERLINE, TCL_AUTO_LENGTH, offsetof(TkMenuEntry, underline), 0, NULL, 0},
+ DEF_MENU_ENTRY_UNDERLINE, TCL_INDEX_NONE, offsetof(TkMenuEntry, underline), 0, NULL, 0},
{TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0}
};
static const Tk_OptionSpec tkSeparatorEntryConfigSpecs[] = {
{TK_OPTION_BORDER, "-background", NULL, NULL,
DEF_MENU_ENTRY_BG,
- offsetof(TkMenuEntry, borderPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, borderPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0}
};
static const Tk_OptionSpec tkCheckButtonEntryConfigSpecs[] = {
{TK_OPTION_BOOLEAN, "-indicatoron", NULL, NULL,
DEF_MENU_ENTRY_INDICATOR,
- TCL_AUTO_LENGTH, offsetof(TkMenuEntry, indicatorOn), 0, NULL, 0},
+ TCL_INDEX_NONE, offsetof(TkMenuEntry, indicatorOn), 0, NULL, 0},
{TK_OPTION_STRING, "-offvalue", NULL, NULL,
DEF_MENU_ENTRY_OFF_VALUE,
- offsetof(TkMenuEntry, offValuePtr), TCL_AUTO_LENGTH, 0, NULL, 0},
+ offsetof(TkMenuEntry, offValuePtr), TCL_INDEX_NONE, 0, NULL, 0},
{TK_OPTION_STRING, "-onvalue", NULL, NULL,
DEF_MENU_ENTRY_ON_VALUE,
- offsetof(TkMenuEntry, onValuePtr), TCL_AUTO_LENGTH, 0, NULL, 0},
+ offsetof(TkMenuEntry, onValuePtr), TCL_INDEX_NONE, 0, NULL, 0},
{TK_OPTION_COLOR, "-selectcolor", NULL, NULL,
DEF_MENU_ENTRY_SELECT,
- offsetof(TkMenuEntry, indicatorFgPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, indicatorFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-selectimage", NULL, NULL,
DEF_MENU_ENTRY_SELECT_IMAGE,
- offsetof(TkMenuEntry, selectImagePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, selectImagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-variable", NULL, NULL,
DEF_MENU_ENTRY_CHECK_VARIABLE,
- offsetof(TkMenuEntry, namePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, namePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_END, NULL, NULL, NULL,
- NULL, 0, TCL_AUTO_LENGTH, 0, tkBasicMenuEntryConfigSpecs, 0}
+ NULL, 0, TCL_INDEX_NONE, 0, tkBasicMenuEntryConfigSpecs, 0}
};
static const Tk_OptionSpec tkRadioButtonEntryConfigSpecs[] = {
{TK_OPTION_BOOLEAN, "-indicatoron", NULL, NULL,
DEF_MENU_ENTRY_INDICATOR,
- TCL_AUTO_LENGTH, offsetof(TkMenuEntry, indicatorOn), 0, NULL, 0},
+ TCL_INDEX_NONE, offsetof(TkMenuEntry, indicatorOn), 0, NULL, 0},
{TK_OPTION_COLOR, "-selectcolor", NULL, NULL,
DEF_MENU_ENTRY_SELECT,
- offsetof(TkMenuEntry, indicatorFgPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, indicatorFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-selectimage", NULL, NULL,
DEF_MENU_ENTRY_SELECT_IMAGE,
- offsetof(TkMenuEntry, selectImagePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, selectImagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-value", NULL, NULL,
DEF_MENU_ENTRY_VALUE,
- offsetof(TkMenuEntry, onValuePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, onValuePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-variable", NULL, NULL,
DEF_MENU_ENTRY_RADIO_VARIABLE,
- offsetof(TkMenuEntry, namePtr), TCL_AUTO_LENGTH, 0, NULL, 0},
+ offsetof(TkMenuEntry, namePtr), TCL_INDEX_NONE, 0, NULL, 0},
{TK_OPTION_END, NULL, NULL, NULL,
- NULL, 0, TCL_AUTO_LENGTH, 0, tkBasicMenuEntryConfigSpecs, 0}
+ NULL, 0, TCL_INDEX_NONE, 0, tkBasicMenuEntryConfigSpecs, 0}
};
static const Tk_OptionSpec tkCascadeEntryConfigSpecs[] = {
{TK_OPTION_STRING, "-menu", NULL, NULL,
DEF_MENU_ENTRY_MENU,
- offsetof(TkMenuEntry, namePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, namePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_END, NULL, NULL, NULL,
- NULL, 0, TCL_AUTO_LENGTH, 0, tkBasicMenuEntryConfigSpecs, 0}
+ NULL, 0, TCL_INDEX_NONE, 0, tkBasicMenuEntryConfigSpecs, 0}
};
static const Tk_OptionSpec tkTearoffEntryConfigSpecs[] = {
{TK_OPTION_BORDER, "-background", NULL, NULL,
DEF_MENU_ENTRY_BG,
- offsetof(TkMenuEntry, borderPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenuEntry, borderPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING_TABLE, "-state", NULL, NULL,
- DEF_MENU_ENTRY_STATE, TCL_AUTO_LENGTH, offsetof(TkMenuEntry, state), 0,
+ DEF_MENU_ENTRY_STATE, TCL_INDEX_NONE, offsetof(TkMenuEntry, state), 0,
(ClientData) menuStateStrings, 0},
{TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0}
};
@@ -250,62 +250,62 @@ static const char *const menuTypeStrings[] = {
static const Tk_OptionSpec tkMenuConfigSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground",
"Foreground", DEF_MENU_ACTIVE_BG_COLOR,
- offsetof(TkMenu, activeBorderPtr), TCL_AUTO_LENGTH, 0,
+ offsetof(TkMenu, activeBorderPtr), TCL_INDEX_NONE, 0,
(ClientData) DEF_MENU_ACTIVE_BG_MONO, 0},
{TK_OPTION_PIXELS, "-activeborderwidth", "activeBorderWidth",
"BorderWidth", DEF_MENU_ACTIVE_BORDER_WIDTH,
- offsetof(TkMenu, activeBorderWidthPtr), TCL_AUTO_LENGTH, 0, NULL, 0},
+ offsetof(TkMenu, activeBorderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0},
{TK_OPTION_COLOR, "-activeforeground", "activeForeground",
"Background", DEF_MENU_ACTIVE_FG_COLOR,
- offsetof(TkMenu, activeFgPtr), TCL_AUTO_LENGTH, 0,
+ offsetof(TkMenu, activeFgPtr), TCL_INDEX_NONE, 0,
(ClientData) DEF_MENU_ACTIVE_FG_MONO, 0},
{TK_OPTION_RELIEF, "-activerelief", "activeRelief", "Relief",
DEF_MENU_ACTIVE_RELIEF, offsetof(TkMenu, activeReliefPtr),
- TCL_AUTO_LENGTH, 0, NULL, 0},
+ TCL_INDEX_NONE, 0, NULL, 0},
{TK_OPTION_BORDER, "-background", "background", "Background",
- DEF_MENU_BG_COLOR, offsetof(TkMenu, borderPtr), TCL_AUTO_LENGTH, 0,
+ DEF_MENU_BG_COLOR, offsetof(TkMenu, borderPtr), TCL_INDEX_NONE, 0,
(ClientData) DEF_MENU_BG_MONO, 0},
{TK_OPTION_SYNONYM, "-bd", NULL, NULL,
- NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0},
+ NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
{TK_OPTION_SYNONYM, "-bg", NULL, NULL,
- NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0},
+ NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
DEF_MENU_BORDER_WIDTH,
- offsetof(TkMenu, borderWidthPtr), TCL_AUTO_LENGTH, 0, NULL, 0},
+ offsetof(TkMenu, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_MENU_CURSOR,
- offsetof(TkMenu, cursorPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenu, cursorPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
"DisabledForeground", DEF_MENU_DISABLED_FG_COLOR,
- offsetof(TkMenu, disabledFgPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK,
+ offsetof(TkMenu, disabledFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK,
(ClientData) DEF_MENU_DISABLED_FG_MONO, 0},
{TK_OPTION_SYNONYM, "-fg", NULL, NULL,
- NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0},
+ NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
- DEF_MENU_FONT, offsetof(TkMenu, fontPtr), TCL_AUTO_LENGTH, 0, NULL, 0},
+ DEF_MENU_FONT, offsetof(TkMenu, fontPtr), TCL_INDEX_NONE, 0, NULL, 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
- DEF_MENU_FG, offsetof(TkMenu, fgPtr), TCL_AUTO_LENGTH, 0, NULL, 0},
+ DEF_MENU_FG, offsetof(TkMenu, fgPtr), TCL_INDEX_NONE, 0, NULL, 0},
{TK_OPTION_STRING, "-postcommand", "postCommand", "Command",
DEF_MENU_POST_COMMAND,
- offsetof(TkMenu, postCommandPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenu, postCommandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
- DEF_MENU_RELIEF, offsetof(TkMenu, reliefPtr), TCL_AUTO_LENGTH, 0, NULL, 0},
+ DEF_MENU_RELIEF, offsetof(TkMenu, reliefPtr), TCL_INDEX_NONE, 0, NULL, 0},
{TK_OPTION_COLOR, "-selectcolor", "selectColor", "Background",
- DEF_MENU_SELECT_COLOR, offsetof(TkMenu, indicatorFgPtr), TCL_AUTO_LENGTH, 0,
+ DEF_MENU_SELECT_COLOR, offsetof(TkMenu, indicatorFgPtr), TCL_INDEX_NONE, 0,
(ClientData) DEF_MENU_SELECT_MONO, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
DEF_MENU_TAKE_FOCUS,
- offsetof(TkMenu, takeFocusPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenu, takeFocusPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BOOLEAN, "-tearoff", "tearOff", "TearOff",
- DEF_MENU_TEAROFF, TCL_AUTO_LENGTH, offsetof(TkMenu, tearoff), 0, NULL, 0},
+ DEF_MENU_TEAROFF, TCL_INDEX_NONE, offsetof(TkMenu, tearoff), 0, NULL, 0},
{TK_OPTION_STRING, "-tearoffcommand", "tearOffCommand",
"TearOffCommand", DEF_MENU_TEAROFF_CMD,
- offsetof(TkMenu, tearoffCommandPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenu, tearoffCommandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-title", "title", "Title",
- DEF_MENU_TITLE, offsetof(TkMenu, titlePtr), TCL_AUTO_LENGTH,
+ DEF_MENU_TITLE, offsetof(TkMenu, titlePtr), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING_TABLE, "-type", "type", "Type",
- DEF_MENU_TYPE, offsetof(TkMenu, menuTypePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK,
+ DEF_MENU_TYPE, offsetof(TkMenu, menuTypePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK,
(ClientData) menuTypeStrings, 0},
{TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0}
};