diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-03-20 08:31:04 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-03-20 08:31:04 (GMT) |
commit | 522f8027b2de092fb9684f8135dedc0aba75217c (patch) | |
tree | cd2c4c457e71e8ea2303c50cf887eb3d15bc6d87 /generic/ttk/ttkEntry.c | |
parent | 55b8b289c6821cff7faa7552c53d0ee5d11e93f4 (diff) | |
download | tk-522f8027b2de092fb9684f8135dedc0aba75217c.zip tk-522f8027b2de092fb9684f8135dedc0aba75217c.tar.gz tk-522f8027b2de092fb9684f8135dedc0aba75217c.tar.bz2 |
More usage of (internal) TkGetIntForIndex() function, and give this function an additional parameter "lastOK". This way,
"end" doesn't need to be handled especially in other code places, all is centralized in this single functions.
Only Ttk's "treeview" not done yet, since that requires handling a linked list in stead of an array.
Diffstat (limited to 'generic/ttk/ttkEntry.c')
-rw-r--r-- | generic/ttk/ttkEntry.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 8abcd9b..12a0b57 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1372,7 +1372,7 @@ EntryIndex( TkSizeT length, idx; const char *string; - if (TCL_OK == TkGetIntForIndex(indexObj, entryPtr->entry.numChars, &idx)) { + if (TCL_OK == TkGetIntForIndex(indexObj, entryPtr->entry.numChars - 1, 1, &idx)) { if (idx + 1 > (TkSizeT)entryPtr->entry.numChars + 1) { idx = (TkSizeT)entryPtr->entry.numChars; } @@ -1852,7 +1852,7 @@ static int ComboboxCurrentCommand( } else if (objc == 3) { TkSizeT idx; - if (TCL_OK == TkGetIntForIndex(objv[2], nValues - 1, &idx)) { + if (TCL_OK == TkGetIntForIndex(objv[2], nValues - 1, 0, &idx)) { if (idx == TCL_INDEX_NONE || idx > (TkSizeT)nValues) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "index \"%s\" out of range", Tcl_GetString(objv[2]))); |