Text Indexes and Modifiers
In a Text widget, several indexes are defined to identify positions in the text. These are used by the methods that retrieve and manipulate text.
n.mNumbers representing character
mon linen@x,yThe character closest to the
x,ycoordinateendThe end of the text
insertThe character after the insert cursor
currentThe position closest to the mouse cursor
markOther marks defined for the widget (see discussion of text marks later in this section)
sel.firstThe first selected character
sel.lastThe character just after the last selected character
tag.firstThe first character in the widget of the specified tag type
tag.lastThe character just after the last character of the specified tag type
widgetThe location of an embedded widget
There are also several modifiers to use with text indexes. They are:
-n lines+n linesnlines before or after the index-n chars+n charsncharacters before or after the indexlinestartThe first character on the line
lineendThe last character on the line (often a newline)
wordstartThe first character in the word
wordendThe character after the last character in the word