A Text widget displays and edits multi-line text. Portions of the text may be styled with tags, particular positions may be annotated with floating marks, and arbitrary images and other widgets may be embedded in the text. The widget also provides an unlimited undo/redo mechanism and supports peer widgets that share the same underlying data. Inherits from Widget, XView and YView, so the view can be scrolled horizontally and vertically with xview() and yview(). Refer to the Tk text manual page for the full list of options.
Return a tuple (x, y, width, height) giving the bounding box, in pixels, of the visible part of the character at index, or None if that character is not visible on the screen.
Compare the positions of index1 and index2 using the relational operator op, which must be one of '<', '<=', '==', '>=', '>' or '!=', and return the boolean result.
Return a tuple (x, y, width, height, baseline) describing the display line that contains index: the first four values give the bounding box of the line in pixels and baseline gives the offset of the …
Return the contents of the widget from index1 up to but not including index2 (or just the segment at index1 if index2 is omitted), including text and information about marks, tags, images and windows.
Low-level wrapper around the Tk edit widget command that controls the undo/redo mechanism and the modified flag; args is the edit subcommand and its arguments.
If arg is omitted, return the current state of the modified flag as true or false; the flag is set automatically whenever the text is inserted or deleted.
Undo the most recent edit action, that is, all the inserts and deletes recorded on the undo stack since the previous separator, and move it to the redo stack.
Embed an image at index and return the name assigned to this image instance, which may then be used as an index or passed to the other image_* methods.
If index is omitted, return a tuple of the names of all tags defined in the widget; otherwise return only the names of the tags applied to the character at index.
Search forward from index1 (up to index2 if given) for the first range of characters tagged with tagName, and return a two-element tuple of its start and end indices, or an empty tuple if there is no…
Search backward from index1 (down to index2 if given) for the nearest preceding range of characters tagged with tagName, and return a two-element tuple of its start and end indices, or an empty tuple…