diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-12-14 11:46:52 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-12-14 11:46:52 (GMT) |
commit | 5357570e1f8319ecea3ce3c930913200ebc485dd (patch) | |
tree | 5eb91720f2a780a9857925f899b41a90af702333 /generic | |
parent | d3accd1f1590ad5fd9a5bac5f611912c8dd9809c (diff) | |
parent | 953c81157e52a85fb0e0322336b34ee6367ea6d4 (diff) | |
download | tk-5357570e1f8319ecea3ce3c930913200ebc485dd.zip tk-5357570e1f8319ecea3ce3c930913200ebc485dd.tar.gz tk-5357570e1f8319ecea3ce3c930913200ebc485dd.tar.bz2 |
Merge 8.6. Make anchorStrings, reliefString and justifyString MODULE_SCOPE
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tk3d.c | 4 | ||||
-rw-r--r-- | generic/tkGet.c | 8 | ||||
-rw-r--r-- | generic/tkInt.h | 12 | ||||
-rw-r--r-- | generic/ttk/ttkEntry.c | 8 |
4 files changed, 19 insertions, 13 deletions
diff --git a/generic/tk3d.c b/generic/tk3d.c index 249d62c..e988d3e 100644 --- a/generic/tk3d.c +++ b/generic/tk3d.c @@ -19,7 +19,7 @@ * by Tk_GetReliefFromObj. */ -static const char *const reliefStrings[] = { +const char *const tkReliefStrings[] = { "flat", "groove", "raised", "ridge", "solid", "sunken", NULL }; @@ -623,7 +623,7 @@ Tk_GetReliefFromObj( * from. */ int *resultPtr) /* Where to place the answer. */ { - return Tcl_GetIndexFromObjStruct(interp, objPtr, reliefStrings, + return Tcl_GetIndexFromObjStruct(interp, objPtr, tkReliefStrings, sizeof(char *), "relief", 0, resultPtr); } diff --git a/generic/tkGet.c b/generic/tkGet.c index cc8c6f9..7df6ead 100644 --- a/generic/tkGet.c +++ b/generic/tkGet.c @@ -35,10 +35,10 @@ static void FreeUidThreadExitProc(ClientData clientData); * used by Tk_GetAnchorFromObj and Tk_GetJustifyFromObj. */ -static const char *const anchorStrings[] = { +const char *const tkAnchorStrings[] = { "n", "ne", "e", "se", "s", "sw", "w", "nw", "center", NULL }; -static const char *const justifyStrings[] = { +const char *const tkJustifyStrings[] = { "left", "right", "center", NULL }; @@ -71,7 +71,7 @@ Tk_GetAnchorFromObj( { int index, code; - code = Tcl_GetIndexFromObj(interp, objPtr, anchorStrings, "anchor", 0, + code = Tcl_GetIndexFromObj(interp, objPtr, tkAnchorStrings, "anchor", 0, &index); if (code == TCL_OK) { *anchorPtr = (Tk_Anchor) index; @@ -385,7 +385,7 @@ Tk_GetJustifyFromObj( { int index, code; - code = Tcl_GetIndexFromObj(interp, objPtr, justifyStrings, + code = Tcl_GetIndexFromObj(interp, objPtr, tkJustifyStrings, "justification", 0, &index); if (code == TCL_OK) { *justifyPtr = (Tk_Justify) index; diff --git a/generic/tkInt.h b/generic/tkInt.h index 031630b..0e46a52 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -125,9 +125,7 @@ /* * Fallback in case Tk is linked against a Tcl version not having TIP #585 - * (TCL_INDEX_TEMP_TABLE flag). This allows to use the internal - * INDEX_TEMP_TABLE flag of Tcl. However this is rather ugly and not robust - * since nothing prevents Tcl from changing the value of its internal flags! + * (TCL_INDEX_TEMP_TABLE). */ #if !defined(TCL_INDEX_TEMP_TABLE) @@ -912,6 +910,14 @@ typedef struct TkWindow { } TkWindow; /* + * String tables: + */ + +MODULE_SCOPE const char *const tkAnchorStrings[]; +MODULE_SCOPE const char *const tkReliefStrings[]; +MODULE_SCOPE const char *const tkJustifyStrings[]; + +/* * Real definition of some events. Note that these events come from outside * but have internally generated pieces added to them. */ diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 0069199..b0502a4 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1396,10 +1396,10 @@ EntryIndex( if (idx == TCL_INDEX_NONE) { idx = 0; } else if (idx > entryPtr->entry.numChars) { - idx = entryPtr->entry.numChars; - } - *indexPtr = idx; - return TCL_OK; + idx = entryPtr->entry.numChars; + } + *indexPtr = idx; + return TCL_OK; } string = Tcl_GetStringFromObj(indexObj, &length); |