Overview of Item Types
scale
command or the -position itemconfigure option.
base modifier modifier modifier ...
line.charIndicates char'th character on line line. Lines are numbered from 0. Notice that this is different than the Tk text widget. Within a line, characters are numbered from 0.
line.endIndicates the last character on line line. Lines are numbered from 0.
charIndicates the char'th character from the beginning of the file (starting at 0).
@x,yIndicates the character that covers the pixel whose x and y coordinates within the text's window are x and y.
endIndicates the last character in the text.
markIndicates the character just after the mark whose name is mark.
+ count charsAdjust the index forward by count characters, moving to later lines in the text if necessary. If there are fewer than count characters in the text after the current index, then set the index to the last character in the text. Spaces on either side of count are optional.
- count charsAdjust the index backward by count characters, moving to earlier lines in the text if necessary. If there are fewer than count characters in the text before the current index, then set the index to the first character in the text. Spaces on either side of count are optional.
+ count linesAdjust the index forward by count lines, retaining the same character position within the line. If there are fewer than count lines after the line containing the current index, then set the index to refer to the same character position on the last line of the text. Then, if the line is not long enough to contain a character at the indicated character position, adjust the character position to refer to the last character of the line. Spaces on either side of count are optional.
- count linesAdjust the index backward by count lines, retaining the same character position within the line. If there are fewer than count lines before the line containing the current index, then set the index to refer to the same character position on the first line of the text. Then, if the line is not long enough to contain a character at the indicated character position, adjust the character position to refer to the last character of the line. Spaces on either side of count are optional.
linestartAdjust the index to refer to the first character on the line.
lineendAdjust the index to refer to the last character on the line.
wordstartAdjust the index to refer to the first character of the word containing the current index. A word consists of any number of adjacent characters that are letters, digits, or underscores, or a single character that is not one of these.
wordendAdjust the index to refer to the character just after the last one of the word containing the current index. If the current index refers to the last character of the text then it is not modified.
end - 1 chars"
refers to the next-to-last character in the text and "insert wordstart - 1 c"
refers to the character just before the first one in the word containing the insertion cursor.
mark
sub-command, and their current locations may be determined by using the mark name as an index in widget commands. One mark has special significance. The mark insert is associated with the insertion cursor. The mark point is an synonym for insert. This special mark may not be unset.
USAGE
Text items are supported by the Pad++ text command. Text items are created with widget commands of the following form:
pathName create text [option value option value ...]There may be any number of option-value pairs, each of which sets one of the configuration options for the item. These same option-value pairs may be used in itemconfigure widget commands to change the item's configuration. The following options are supported for text items:
-editable [18]
True if text item is editable with default event handlers (default is false)
-font
[24] Specifies font to use for text
-pen
[45] Specifies pen color of item
-text [56]
The text of any item containing text
Also, see the text [91]
command that can be used to manipulate text items.
Text items have default event bindings which can be used for emacs-style editing of them. See the section on Default Bindings for more info.
Copyright Computer Science Department, The University of New Mexico