📄 text.n
字号:
a list describing the one named option (this list will be identical tothe corresponding sublist of the value returned if no \fIoption\fRis specified).If one or more \fIoption\-value\fR pairs are specified, then the commandmodifies the given option(s) to have the given value(s) in \fItagName\fR;in this case the command returns an empty string.See TAGS above for details on the options available for tags..TP\fIpathName \fBtag delete \fItagName \fR?\fItagName ...\fR?Deletes all tag information for each of the \fItagName\fRarguments.The command removes the tags from all characters in the fileand also deletes any other information associated with the tags,such as bindings and display information.The command returns an empty string..TP\fIpathName\fB tag lower \fItagName \fR?\fIbelowThis\fR?Changes the priority of tag \fItagName\fR so that it is just lowerin priority than the tag whose name is \fIbelowThis\fR.If \fIbelowThis\fR is omitted, then \fItagName\fR's priorityis changed to make it lowest priority of all tags..TP\fIpathName \fBtag names \fR?\fIindex\fR?Returns a list whose elements are the names of all the tags thatare active at the character position given by \fIindex\fR.If \fIindex\fR is omitted, then the return value will describeall of the tags that exist for the text (this includes all tagsthat have been named in a ``\fIpathName \fBtag\fR'' widgetcommand but haven't been deleted by a ``\fIpathName \fBtag delete\fR''widget command, even if no characters are currently marked withthe tag).The list will be sorted in order from lowest priority to highestpriority..TP\fIpathName \fBtag nextrange \fItagName index1 \fR?\fIindex2\fR?This command searches the text for a range of characters taggedwith \fItagName\fR where the first character of the range isno earlier than the character at \fIindex1\fR and no later thanthe character just before \fIindex2\fR (a range starting at\fIindex2\fR will not be considered).If several matching ranges exist, the first one is chosen.The command's return value is a list containingtwo elements, which are the index of the first character of therange and the index of the character just after the last one inthe range.If no matching range is found then the return value is anempty string.If \fIindex2\fR is not given then it defaults to the end of the text..TP\fIpathName \fBtag prevrange \fItagName index1 \fR?\fIindex2\fR?This command searches the text for a range of characters taggedwith \fItagName\fR where the first character of the range isbefore the character at \fIindex1\fR and no earlier thanthe character at \fIindex2\fR (a range starting at\fIindex2\fR will be considered).If several matching ranges exist, the one closest to \fIindex1\fR is chosen.The command's return value is a list containingtwo elements, which are the index of the first character of therange and the index of the character just after the last one inthe range.If no matching range is found then the return value is anempty string.If \fIindex2\fR is not given then it defaults to the beginning of the text..TP\fIpathName\fB tag raise \fItagName \fR?\fIaboveThis\fR?Changes the priority of tag \fItagName\fR so that it is just higherin priority than the tag whose name is \fIaboveThis\fR.If \fIaboveThis\fR is omitted, then \fItagName\fR's priorityis changed to make it highest priority of all tags..TP\fIpathName \fBtag ranges \fItagName\fRReturns a list describing all of the ranges of text that have beentagged with \fItagName\fR.The first two elements of the list describe the first tagged rangein the text, the next two elements describe the second range, andso on.The first element of each pair contains the index of the firstcharacter of the range, and the second element of the pair containsthe index of the character just after the last one in therange.If there are no characters tagged with \fItag\fR then anempty string is returned..TP\fIpathName \fBtag remove \fItagName index1 \fR?\fIindex2 index1 index2 ...\fR?Remove the tag \fItagName\fR from all of the characters startingat \fIindex1\fR and ending just before\fIindex2\fR (the character at \fIindex2\fR isn't affected).A single command may contain any number of \fIindex1\fR\-\fIindex2\fRpairs.If the last \fIindex2\fR is omitted then the single character at\fIindex1\fR is tagged.If there are no characters in the specified range (e.g. \fIindex1\fRis past the end of the file or \fIindex2\fR is less than or equalto \fIindex1\fR) then the command has no effect.This command returns an empty string..RE.TP\fIpathName \fBwindow \fIoption \fR?\fIarg arg ...\fR?This command is used to manipulate embedded windows.The behavior of the command depends on the \fIoption\fR argumentthat follows the \fBtag\fR argument.The following forms of the command are currently supported:.RS.TP\fIpathName \fBwindow cget\fR \fIindex option\fRReturns the value of a configuration option for an embedded window.\fIIndex\fR identifies the embedded window, and \fIoption\fRspecifies a particular configuration option, which must be one ofthe ones listed in the section EMBEDDED WINDOWS..TP\fIpathName \fBwindow configure \fIindex\fR ?\fIoption value ...\fR?Query or modify the configuration options for an embedded window.If no \fIoption\fR is specified, returns a list describing all ofthe available options for the embedded window at \fIindex\fR(see \fBTk_ConfigureInfo\fR for information on the format of this list).If \fIoption\fR is specified with no \fIvalue\fR, then the commandreturns a list describing the one named option (this list will beidentical to the corresponding sublist of the value returned if no\fIoption\fR is specified).If one or more \fIoption\-value\fR pairs are specified, then the commandmodifies the given option(s) to have the given value(s); inthis case the command returns an empty string.See EMBEDDED WINDOWS for information on the options thatare supported..TP\fIpathName \fBwindow create \fIindex\fR ?\fIoption value ...\fR?This command creates a new window annotation, which will appearin the text at the position given by \fIindex\fR.Any number of \fIoption\-value\fR pairs may be specified toconfigure the annotation.See EMBEDDED WINDOWS for information on the options thatare supported.Returns an empty string..TP\fIpathName \fBwindow names\fRReturns a list whose elements are the names of all windows currentlyembedded in \fIwindow\fR..RE.TP\fIpathName \fBxview \fIoption args\fRThis command is used to query and change the horizontal position of thetext in the widget's window. It can take any of the followingforms:.RS.TP\fIpathName \fBxview\fRReturns a list containing two elements.Each element is a real fraction between 0 and 1; together they describethe portion of the document's horizontal span that is visible inthe window.For example, if the first element is .2 and the second element is .6,20% of the text is off-screen to the left, the middle 40% is visiblein the window, and 40% of the text is off-screen to the right.The fractions refer only to the lines that are actually visible in thewindow: if the lines in the window are all very short, so that theyare entirely visible, the returned fractions will be 0 and 1,even if there are other lines in the text that aremuch wider than the window.These are the same values passed to scrollbars via the \fB\-xscrollcommand\fRoption..TP\fIpathName \fBxview moveto\fI fraction\fRAdjusts the view in the window so that \fIfraction\fR of the horizontalspan of the text is off-screen to the left.\fIFraction\fR is a fraction between 0 and 1..TP\fIpathName \fBxview scroll \fInumber what\fRThis command shifts the view in the window left or right according to\fInumber\fR and \fIwhat\fR.\fINumber\fR must be an integer.\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviationof one of these.If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by\fInumber\fR average-width characters on the display; if it is\fBpages\fR then the view adjusts by \fInumber\fR screenfuls.If \fInumber\fR is negative then characters farther to the leftbecome visible; if it is positive then characters farther to the rightbecome visible..RE.TP\fIpathName \fByview \fI?args\fR?This command is used to query and change the vertical position of thetext in the widget's window.It can take any of the following forms:.RS.TP\fIpathName \fByview\fRReturns a list containing two elements, both of which are real fractionsbetween 0 and 1.The first element gives the position of the first character in thetop line in the window, relative to the text as a whole (0.5 meansit is halfway through the text, for example).The second element gives the position of the character just afterthe last one in the bottom line of the window,relative to the text as a whole.These are the same values passed to scrollbars via the \fB\-yscrollcommand\fRoption..TP\fIpathName \fByview moveto\fI fraction\fRAdjusts the view in the window so that the character given by \fIfraction\fRappears on the top line of the window.\fIFraction\fR is a fraction between 0 and 1; 0 indicates the firstcharacter in the text, 0.33 indicates the character one-third theway through the text, and so on..TP\fIpathName \fByview scroll \fInumber what\fRThis command adjust the view in the window up or down according to\fInumber\fR and \fIwhat\fR.\fINumber\fR must be an integer.\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.If \fIwhat\fR is \fBunits\fR, the view adjusts up or down by\fInumber\fR lines on the display; if it is \fBpages\fR thenthe view adjusts by \fInumber\fR screenfuls.If \fInumber\fR is negative then earlier positions in the textbecome visible; if it is positive then later positions in the textbecome visible..TP\fIpathName \fByview \fR?\fB\-pickplace\fR? \fIindex\fRChanges the view in the widget's window to make \fIindex\fR visible.If the \fB\-pickplace\fR option isn't specified then \fIindex\fR willappear at the top of the window.If \fB\-pickplace\fR is specified then the widget chooses where\fIindex\fR appears in the window:.RS.IP [1]If \fIindex\fR is already visible somewhere in the window then thecommand does nothing..IP [2]If \fIindex\fR is only a few lines off-screen above the window thenit will be positioned at the top of the window..IP [3]If \fIindex\fR is only a few lines off-screen below the window thenit will be positioned at the bottom of the window..IP [4]Otherwise, \fIindex\fR will be centered in the window..LPThe \fB\-pickplace\fR option has been obsoleted by the \fBsee\fR widgetcommand (\fBsee\fR handles both x- and y-motion to make a locationvisible, whereas \fB\-pickplace\fR only handles motion in y)..RE.TP\fIpathName \fByview \fInumber\fRThis command makes the first character on the line afterthe one given by \fInumber\fR visible at the top of the window.\fINumber\fR must be an integer.This command used to be used for scrolling, but now it is obsolete..RE.SH BINDINGS.PPTk automatically creates class bindings for texts that give themthe following default behavior.In the descriptions below, ``word'' refers to a contiguous groupof letters, digits, or ``_'' characters, or any single characterother than these..IP [1]Clicking mouse button 1 positions the insertion cursorjust before the character underneath the mouse cursor, sets theinput focus to this widget, and clears any selection in the widget.Dragging with mouse button 1 strokes out a selection betweenthe insertion cursor and the character under the mouse..IP [2]Double-clicking with mouse button 1 selects the word under the mouseand positions the insertion cursor at the beginning of the word.Dragging after a double click will stroke out a selection consistingof whole words..IP [3]Triple-clicking with mouse button 1 selects the line under the mouseand positions the insertion cursor at the beginning of the line.Dragging after a triple click will stroke out a selection consistingof whole lines..IP [4]The ends of the selection can be adjusted by dragging with mousebutton 1 while the Shift key is down; this will adjust the endof the selection that was nearest to the mouse cursor when button1 was pressed.If the button is double-clicked before dragging then the selectionwill be adjusted in units of whole words; if it is triple-clickedthen the selection will be adjusted in units of whole lines..IP [5]Clicking mouse button 1 with the Control key down will reposition theinsertion cursor without affecting the selection..IP [6]If any normal printing characters are typed, they areinserted at the point of the insertion cursor..IP [7]The view in the widget can be adjusted by dragging with mouse button 2.If mouse button 2 is clicked without moving the mouse, the selectionis copied into the text at the position of the mouse cursor.The Insert key also inserts the selection, but at the position ofthe insertion cursor..IP [8]If the mo
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -