Overview of Item Types
scale
command or the -place itemconfigure option.
base modifier modifier modifier ...Where base gives a starting point and the modifiers adjust the index from the starting point (e.g. move forward or backward one character). Every index must contain a base, but the modifiers are optional.
The base for an index must have one of the following forms:
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.
If modifiers follow the base index, each one of them must have one of the forms listed below. Keywords such as chars and wordend may be abbreviated as long as the abbreviation is unambiguous. Modifiers must have one of the following forms:
+ 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.
If more than one modifier is present then they are applied in left-to-right order. For example, the index "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:
[84] -font fontname
(available only for text item types)
Specifies the font to be used for rendering text for this item. fontname must specify a filename which contains an Adobe Type 1 font, or the string "
System
" which causes the Pad++ line-font to be used. Defaults to "System
".
[85] -pen color
(available ony for handle, line, polygon, portal, rectangle, spline, text and textfile item types)
Color specifies a color to use for drawing the text characters; it may have any of the forms accepted by Tk_GetColor. It may also be "none", in which case the text will be not be drawn. This option defaults to black.
[86] -text string
(available only for text and textfile item types)
String specifies the characters to be displayed in the text item. Newline characters cause line breaks, and tab characters are supported. This option defaults to an empty string.
The text
command is described above with the other Pad++ commands under WIDGET COMMANDS.
Generated with Harlequin WebMaker