summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-05-01 12:02:54 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-05-01 12:02:54 (GMT)
commit641eafecd32b65ad9d8adfe6803213421a21bef8 (patch)
treee9a2ac7a0693c3517afe465567be3bea882cf06d /generic
parent5ed4790f7555c57fa47e3467c819aa111c632978 (diff)
parentf8e6b44392467bc7a6d6aba8e4f775517d3686ac (diff)
downloadtk-641eafecd32b65ad9d8adfe6803213421a21bef8.zip
tk-641eafecd32b65ad9d8adfe6803213421a21bef8.tar.gz
tk-641eafecd32b65ad9d8adfe6803213421a21bef8.tar.bz2
merge core-8-6-branch
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCanvText.c18
-rw-r--r--generic/ttk/ttkScroll.c9
-rw-r--r--generic/ttk/ttkTreeview.c1
3 files changed, 17 insertions, 11 deletions
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index cfd0054..1e58ce9 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -957,19 +957,23 @@ DisplayCanvText(
*/
if ((selFirstChar >= 0) && (textPtr->selTextGC != textPtr->gc)) {
- TkDrawAngledTextLayout(display, drawable, textPtr->gc,
- textPtr->textLayout, drawableX, drawableY, textPtr->angle,
- 0, selFirstChar);
+ if (0 < selFirstChar) {
+ TkDrawAngledTextLayout(display, drawable, textPtr->gc,
+ textPtr->textLayout, drawableX, drawableY, textPtr->angle,
+ 0, selFirstChar);
+ }
TkDrawAngledTextLayout(display, drawable, textPtr->selTextGC,
textPtr->textLayout, drawableX, drawableY, textPtr->angle,
selFirstChar, selLastChar + 1);
- TkDrawAngledTextLayout(display, drawable, textPtr->gc,
- textPtr->textLayout, drawableX, drawableY, textPtr->angle,
- selLastChar + 1, -1);
+ if (selLastChar + 1 < textPtr->numChars) {
+ TkDrawAngledTextLayout(display, drawable, textPtr->gc,
+ textPtr->textLayout, drawableX, drawableY, textPtr->angle,
+ selLastChar + 1, textPtr->numChars);
+ }
} else {
TkDrawAngledTextLayout(display, drawable, textPtr->gc,
textPtr->textLayout, drawableX, drawableY, textPtr->angle,
- 0, -1);
+ 0, textPtr->numChars);
}
TkUnderlineAngledTextLayout(display, drawable, textPtr->gc,
textPtr->textLayout, drawableX, drawableY, textPtr->angle,
diff --git a/generic/ttk/ttkScroll.c b/generic/ttk/ttkScroll.c
index 47db6ac..9cf8eae 100644
--- a/generic/ttk/ttkScroll.c
+++ b/generic/ttk/ttkScroll.c
@@ -104,15 +104,18 @@ static int UpdateScrollbar(Tcl_Interp *interp, ScrollHandle h)
Tcl_Release(corePtr);
if (code != TCL_OK && !Tcl_InterpDeleted(interp)) {
- /* Disable the -scrollcommand, add to stack trace:
+ /* Add error to stack trace.
+ * Also set the SCROLL_UPDATE_REQUIRED flag so that a later call to
+ * TtkScrolled has an effect. Indeed, the error in the -scrollcommand
+ * callback may later be gone, for instance the callback proc got
+ * defined in the meantime.
*/
- ckfree(s->scrollCmd);
- s->scrollCmd = 0;
Tcl_AddErrorInfo(interp, /* @@@ "horizontal" / "vertical" */
"\n (scrolling command executed by ");
Tcl_AddErrorInfo(interp, Tk_PathName(h->corePtr->tkwin));
Tcl_AddErrorInfo(interp, ")");
+ TtkScrollbarUpdateRequired(h);
}
return code;
}
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index ccc5e2e..358e409 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -2842,7 +2842,6 @@ static int TreeviewSeeCommand(
TtkRedisplayWidget(&tv->core);
}
}
- tv->tree.yscroll.total = CountRows(tv->tree.root) - 1;
/* Make sure item is visible:
*/