summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-11-14 09:11:48 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-11-14 09:11:48 (GMT)
commit4fe451bdce628ec817ecdebadbcd7f46dc967b41 (patch)
tree5de798bb84f6fa0d65abeb57ebcc8969af5b1968 /generic/tkTextDisp.c
parentc3b96f601ce76e221a2dbd8fe8d747834c4a48ec (diff)
downloadtk-4fe451bdce628ec817ecdebadbcd7f46dc967b41.zip
tk-4fe451bdce628ec817ecdebadbcd7f46dc967b41.tar.gz
tk-4fe451bdce628ec817ecdebadbcd7f46dc967b41.tar.bz2
TIP #438 - [.text pendingyupdate] command added, with corresponding new tests
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 6036222..d740181 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -2920,6 +2920,8 @@ AsyncUpdateLineMetrics(
lineNum = TkTextUpdateLineMetrics(textPtr, lineNum,
dInfoPtr->lastMetricUpdateLine, 256);
+ dInfoPtr->currentMetricUpdateLine = lineNum;
+
if (tkTextDebug) {
char buffer[2 * TCL_INTEGER_SPACE + 1];
@@ -2946,7 +2948,6 @@ AsyncUpdateLineMetrics(
}
return;
}
- dInfoPtr->currentMetricUpdateLine = lineNum;
/*
* Re-arm the timer. We already have a refCount on the text widget so no
@@ -6034,6 +6035,33 @@ TkTextYviewCmd(
/*
*--------------------------------------------------------------
*
+ * TkTextPendingyupdate --
+ *
+ * This function computes how many lines are not up-to-date regarding
+ * asynchronous height calculations.
+ *
+ * Results:
+ * Returns a positive integer corresponding to the number of lines for
+ * which the height is outdated.
+ *
+ * Side effects:
+ * None.
+ *
+ *--------------------------------------------------------------
+ */
+
+int
+TkTextPendingyupdate(
+ TkText *textPtr) /* Information about text widget. */
+{
+ TextDInfo *dInfoPtr = textPtr->dInfoPtr;
+
+ return (dInfoPtr->lastMetricUpdateLine - dInfoPtr->currentMetricUpdateLine);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
* TkTextScanCmd --
*
* This function is invoked to process the "scan" option for the widget