📄 entry.n
字号:
\fIpathName \fBselection \fIoption arg\fRThis command is used to adjust the selection within an entry. Ithas several forms, depending on \fIoption\fR:.RS.TP\fIpathName \fBselection adjust \fIindex\fRLocate the end of the selection nearest to the character given by\fIindex\fR, and adjust that end of the selection to be at \fIindex\fR(i.e including but not going beyond \fIindex\fR). The otherend of the selection is made the anchor point for future\fBselect to\fR commands. If the selectionisn't currently in the entry, then a new selection is created toinclude the characters between \fIindex\fR and the most recentselection anchor point, inclusive.Returns an empty string..TP\fIpathName \fBselection clear\fRClear the selection if it is currently in this widget. If theselection isn't in this widget then the command has no effect.Returns an empty string..TP\fIpathName \fBselection from \fIindex\fRSet the selection anchor point to just before the charactergiven by \fIindex\fR. Doesn't change the selection.Returns an empty string..TP\fIpathName \fBselection present\fRReturns 1 if there is are characters selected in the entry,0 if nothing is selected..TP\fIpathName \fBselection range \fIstart\fR \fIend\fRSets the selection to include the characters starting withthe one indexed by \fIstart\fR and ending with the one justbefore \fIend\fR.If \fIend\fR refers to the same character as \fIstart\fR or anearlier one, then the entry's selection is cleared..TP\fIpathName \fBselection to \fIindex\fRIf \fIindex\fR is before the anchor point, set the selectionto the characters from \fIindex\fR up to but not includingthe anchor point.If \fIindex\fR is the same as the anchor point, do nothing.If \fIindex\fR is after the anchor point, set the selectionto the characters from the anchor point up to but not including\fIindex\fR.The anchor point is determined by the most recent \fBselect from\fRor \fBselect adjust\fR command in this widget.If the selection isn't in this widget then a new selection iscreated using the most recent anchor point specified for the widget.Returns an empty string..RE.TP\fIpathName \fBxview \fIargs\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 horizontal span that is visible in the window.For example, if the first element is .2 and the second element is .6,20% of the entry's 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.These are the same values passed to scrollbars via the \fB\-xscrollcommand\fRoption..TP\fIpathName \fBxview\fR \fIindex\fRAdjusts the view in the window so that the character given by \fIindex\fRis displayed at the left edge of the window..TP\fIpathName \fBxview moveto\fI fraction\fRAdjusts the view in the window so that the character \fIfraction\fR of theway through the text appears at the left edge of the window.\fIFraction\fR must be 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.SH "DEFAULT BINDINGS".PPTk automatically creates class bindings for entries 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 all of the text in theentry and positions the insertion cursor before the first character..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..IP [5]Clicking mouse button 1 with the Control key down will position theinsertion cursor in the entry without affecting the selection..IP [6]If any normal printing characters are typed in an entry, they areinserted at the point of the insertion cursor..IP [7]The view in the entry can be adjusted by dragging with mouse button 2.If mouse button 2 is clicked without moving the mouse, the selectionis copied into the entry at the position of the mouse cursor..IP [8]If the mouse is dragged out of the entry on the left or right sideswhile button 1 is pressed, the entry will automatically scroll tomake more text visible (if there is more text off-screen on the sidewhere the mouse left the window)..IP [9]The Left and Right keys move the insertion cursor one character to theleft or right; they also clear any selection in the entry and setthe selection anchor.If Left or Right is typed with the Shift key down, then the insertioncursor moves and the selection is extended to include the new character.Control-Left and Control-Right move the insertion cursor by words, andControl-Shift-Left and Control-Shift-Right move the insertion cursorby words and also extend the selection.Control-b and Control-f behave the same as Left and Right, respectively.Meta-b and Meta-f behave the same as Control-Left and Control-Right,respectively..IP [10]The Home key, or Control-a, will move the insertion cursor to thebeginning of the entry and clear any selection in the entry.Shift-Home moves the insertion cursor to the beginning of the entryand also extends the selection to that point..IP [11]The End key, or Control-e, will move the insertion cursor to theend of the entry and clear any selection in the entry.Shift-End moves the cursor to the end and extends the selectionto that point..IP [12]The Select key and Control-Space set the selection anchor to the positionof the insertion cursor. They don't affect the current selection.Shift-Select and Control-Shift-Space adjust the selection to thecurrent position of the insertion cursor, selecting from the anchorto the insertion cursor if there was not any selection previously..IP [13]Control-/ selects all the text in the entry..IP [14]Control-\e clears any selection in the entry..IP [15]The F16 key (labelled Copy on many Sun workstations) or Meta-wcopies the selection in the widget to the clipboard, if there is a selection..IP [16]The F20 key (labelled Cut on many Sun workstations) or Control-wcopies the selection in the widget to the clipboard and deletesthe selection.If there is no selection in the widget then these keys have no effect..IP [17]The F18 key (labelled Paste on many Sun workstations) or Control-yinserts the contents of the clipboard at the position of theinsertion cursor..IP [18]The Delete key deletes the selection, if there is one in the entry.If there is no selection, it deletes the character to the right ofthe insertion cursor..IP [19]The BackSpace key and Control-h delete the selection, if there is onein the entry.If there is no selection, it deletes the character to the left ofthe insertion cursor..IP [20]Control-d deletes the character to the right of the insertion cursor..IP [21]Meta-d deletes the word to the right of the insertion cursor..IP [22]Control-k deletes all the characters to the right of the insertioncursor..IP [23]Control-t reverses the order of the two characters to the right ofthe insertion cursor..PPIf the entry is disabled using the \fB\-state\fR option, then the entry'sview can still be adjusted and text in the entry can still be selected,but no insertion cursor will be displayed and no text modifications willtake place..PPThe behavior of entries can be changed by defining new bindings forindividual widgets or by redefining the class bindings..SH KEYWORDSentry, widget
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -