summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--generic/tkEntry.c4
-rw-r--r--generic/ttk/ttkEntry.c8
-rw-r--r--generic/ttk/ttkScroll.c5
4 files changed, 15 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index dbbc026..f1f81ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
* generic/ttk/ttkScroll.c: [Bug 3613759]: ttk::entry and symbolic
index names.
+ * generic/ttk/ttkEntry.c: [Bug 2100430]: ttk::entry widget index
+ must be integer
+ * generic/tkEntry.c: Don't set interp result when it will be
+ overwritten later.
2013-06-04 Jan Nijtmans <nijtmans@users.sf.net>
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 1244273..f68e1a3 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -2560,7 +2560,7 @@ GetEntryIndex(
case '@': {
int x, roundUp, maxWidth;
- if (Tcl_GetInt(interp, string + 1, &x) != TCL_OK) {
+ if (Tcl_GetInt(NULL, string + 1, &x) != TCL_OK) {
goto badIndex;
}
if (x < entryPtr->inset) {
@@ -2589,7 +2589,7 @@ GetEntryIndex(
break;
}
default:
- if (Tcl_GetInt(interp, string, indexPtr) != TCL_OK) {
+ if (Tcl_GetInt(NULL, string, indexPtr) != TCL_OK) {
goto badIndex;
}
if (*indexPtr < 0){
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 62a2720..f395649 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -1644,6 +1644,14 @@ static int EntryXViewCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = recordPtr;
+ if (objc == 3) {
+ int newFirst;
+ if (EntryIndex(interp, entryPtr, objv[2], &newFirst) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ TtkScrollTo(entryPtr->entry.xscrollHandle, newFirst);
+ return TCL_OK;
+ }
return TtkScrollviewCommand(interp, objc, objv, entryPtr->entry.xscrollHandle);
}
diff --git a/generic/ttk/ttkScroll.c b/generic/ttk/ttkScroll.c
index 2ff3d8e..2bd3ddb 100644
--- a/generic/ttk/ttkScroll.c
+++ b/generic/ttk/ttkScroll.c
@@ -202,10 +202,7 @@ int TtkScrollviewCommand(
Tcl_SetObjResult(interp, Tcl_NewListObj(2, result));
return TCL_OK;
} else if (objc == 3) {
- const char *string = Tcl_GetString(objv[2]);
- if (strcmp(string, "end") == 0) {
- newFirst = s->total;
- } else if (Tcl_GetIntFromObj(interp, objv[2], &newFirst) != TCL_OK) {
+ if (Tcl_GetIntFromObj(interp, objv[2], &newFirst) != TCL_OK) {
return TCL_ERROR;
}
} else {