diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-05-17 14:30:10 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-05-17 14:30:10 (GMT) |
commit | b57fd64f0b6a601210b3a91bb3afa78ab1b9d28c (patch) | |
tree | 0b3fda6e6c85bf245c7ad42cabee8f06fd6a4687 /generic/tkText.c | |
parent | 52d33317608b7963059a1ca37e3d3cc9d5c9aa44 (diff) | |
parent | 4e04d8c4e5426b6166e7100e72ab3e01b5e71af1 (diff) | |
download | tk-b57fd64f0b6a601210b3a91bb3afa78ab1b9d28c.zip tk-b57fd64f0b6a601210b3a91bb3afa78ab1b9d28c.tar.gz tk-b57fd64f0b6a601210b3a91bb3afa78ab1b9d28c.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tkText.c')
-rw-r--r-- | generic/tkText.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/generic/tkText.c b/generic/tkText.c index f01e7e5..ef4763d 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -43,16 +43,6 @@ #define PIXEL_CLIENTS 5 /* - * The 'TkTextState' enum in tkText.h is used to define a type for the -state - * option of the Text widget. These values are used as indices into the string - * table below. - */ - -static const char *const stateStrings[] = { - "disabled", "normal", NULL -}; - -/* * The 'TkWrapMode' enum in tkText.h is used to define a type for the -wrap * option of the Text widget. These values are used as indices into the string * table below. @@ -179,7 +169,7 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", DEF_TEXT_INSERT_BD_COLOR, TCL_INDEX_NONE, offsetof(TkText, insertBorderWidth), 0, - (ClientData) DEF_TEXT_INSERT_BD_MONO, 0}, + DEF_TEXT_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", DEF_TEXT_INSERT_OFF_TIME, TCL_INDEX_NONE, offsetof(TkText, insertOffTime), 0, 0, 0}, @@ -189,7 +179,7 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-insertunfocussed", "insertUnfocussed", "InsertUnfocussed", DEF_TEXT_INSERT_UNFOCUSSED, TCL_INDEX_NONE, offsetof(TkText, insertUnfocussed), - 0, insertUnfocussedStrings, 0}, + TK_OPTION_ENUM_VAR, insertUnfocussedStrings, 0}, {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", DEF_TEXT_INSERT_WIDTH, TCL_INDEX_NONE, offsetof(TkText, insertWidth), 0, 0, 0}, @@ -230,7 +220,7 @@ static const Tk_OptionSpec optionSpecs[] = { &lineOption, TK_TEXT_LINE_RANGE}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_TEXT_STATE, TCL_INDEX_NONE, offsetof(TkText, state), - 0, stateStrings, 0}, + 0, &tkStateStrings[1], 0}, {TK_OPTION_STRING, "-tabs", "tabs", "Tabs", DEF_TEXT_TABS, offsetof(TkText, tabOptionPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, TK_TEXT_LINE_GEOMETRY}, @@ -248,7 +238,7 @@ static const Tk_OptionSpec optionSpecs[] = { TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING_TABLE, "-wrap", "wrap", "Wrap", DEF_TEXT_WRAP, TCL_INDEX_NONE, offsetof(TkText, wrapMode), - 0, tkTextWrapStrings, TK_TEXT_LINE_GEOMETRY}, + TK_OPTION_ENUM_VAR, tkTextWrapStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", DEF_TEXT_XSCROLL_COMMAND, TCL_INDEX_NONE, offsetof(TkText, xScrollCmd), TK_OPTION_NULL_OK, 0, 0}, @@ -1543,7 +1533,7 @@ TextWidgetObjCmd( textPtr->afterSyncCmd = cmd; } else { textPtr->afterSyncCmd = cmd; - Tcl_DoWhenIdle(TkTextRunAfterSyncCmd, (ClientData) textPtr); + Tcl_DoWhenIdle(TkTextRunAfterSyncCmd, textPtr); } break; } else if (objc != 2) { @@ -5610,13 +5600,13 @@ TkTextRunAfterSyncCmd( return; } - Tcl_Preserve((ClientData) textPtr->interp); + Tcl_Preserve(textPtr->interp); code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); if (code == TCL_ERROR) { Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); Tcl_BackgroundException(textPtr->interp, TCL_ERROR); } - Tcl_Release((ClientData) textPtr->interp); + Tcl_Release(textPtr->interp); Tcl_DecrRefCount(textPtr->afterSyncCmd); textPtr->afterSyncCmd = NULL; } |