diff options
author | fvogel <fvogelnew1@free.fr> | 2015-11-14 00:02:49 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-11-14 00:02:49 (GMT) |
commit | c3b96f601ce76e221a2dbd8fe8d747834c4a48ec (patch) | |
tree | 4cd15909f2e234d6d67b3bdd79510d7c3e81c6f5 /generic/tkText.c | |
parent | 7e0de4a6b4f19d000e66c01ef7a01ca72a3960da (diff) | |
download | tk-c3b96f601ce76e221a2dbd8fe8d747834c4a48ec.zip tk-c3b96f601ce76e221a2dbd8fe8d747834c4a48ec.tar.gz tk-c3b96f601ce76e221a2dbd8fe8d747834c4a48ec.tar.bz2 |
TIP #438 - [.text yupdate] command added, with corresponding new tests
Diffstat (limited to 'generic/tkText.c')
-rw-r--r-- | generic/tkText.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/generic/tkText.c b/generic/tkText.c index cb89218..4d2df7e 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -690,14 +690,14 @@ TextWidgetObjCmd( "bbox", "cget", "compare", "configure", "count", "debug", "delete", "dlineinfo", "dump", "edit", "get", "image", "index", "insert", "mark", "peer", "replace", "scan", "search", "see", "tag", "window", - "xview", "yview", NULL + "xview", "yupdate", "yview", NULL }; enum options { TEXT_BBOX, TEXT_CGET, TEXT_COMPARE, TEXT_CONFIGURE, TEXT_COUNT, TEXT_DEBUG, TEXT_DELETE, TEXT_DLINEINFO, TEXT_DUMP, TEXT_EDIT, TEXT_GET, TEXT_IMAGE, TEXT_INDEX, TEXT_INSERT, TEXT_MARK, TEXT_PEER, TEXT_REPLACE, TEXT_SCAN, TEXT_SEARCH, TEXT_SEE, - TEXT_TAG, TEXT_WINDOW, TEXT_XVIEW, TEXT_YVIEW + TEXT_TAG, TEXT_WINDOW, TEXT_XVIEW, TEXT_YUPDATE, TEXT_YVIEW }; if (objc < 2) { @@ -1494,6 +1494,16 @@ TextWidgetObjCmd( case TEXT_XVIEW: result = TkTextXviewCmd(textPtr, interp, objc, objv); break; + case TEXT_YUPDATE: { + if (objc != 2) { + Tcl_WrongNumArgs(interp, 2, objv, NULL); + result = TCL_ERROR; + goto done; + } + TkTextUpdateLineMetrics(textPtr, 1, + TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr), -1); + break; + } case TEXT_YVIEW: result = TkTextYviewCmd(textPtr, interp, objc, objv); break; |