Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v8plus / man / mann / entry.n
CommitLineData
920dae64
AT
1'\"
2'\" Copyright (c) 1990-1994 The Regents of the University of California.
3'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4'\" Copyright (c) 1998-2000 Scriptics Corporation.
5'\"
6'\" See the file "license.terms" for information on usage and redistribution
7'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8'\"
9'\" RCS: @(#) $Id: entry.n,v 1.11.2.1 2004/10/28 10:19:29 dkf Exp $
10'\"
11'\" The definitions below are for supplemental macros used in Tcl/Tk
12'\" manual entries.
13'\"
14'\" .AP type name in/out ?indent?
15'\" Start paragraph describing an argument to a library procedure.
16'\" type is type of argument (int, etc.), in/out is either "in", "out",
17'\" or "in/out" to describe whether procedure reads or modifies arg,
18'\" and indent is equivalent to second arg of .IP (shouldn't ever be
19'\" needed; use .AS below instead)
20'\"
21'\" .AS ?type? ?name?
22'\" Give maximum sizes of arguments for setting tab stops. Type and
23'\" name are examples of largest possible arguments that will be passed
24'\" to .AP later. If args are omitted, default tab stops are used.
25'\"
26'\" .BS
27'\" Start box enclosure. From here until next .BE, everything will be
28'\" enclosed in one large box.
29'\"
30'\" .BE
31'\" End of box enclosure.
32'\"
33'\" .CS
34'\" Begin code excerpt.
35'\"
36'\" .CE
37'\" End code excerpt.
38'\"
39'\" .VS ?version? ?br?
40'\" Begin vertical sidebar, for use in marking newly-changed parts
41'\" of man pages. The first argument is ignored and used for recording
42'\" the version when the .VS was added, so that the sidebars can be
43'\" found and removed when they reach a certain age. If another argument
44'\" is present, then a line break is forced before starting the sidebar.
45'\"
46'\" .VE
47'\" End of vertical sidebar.
48'\"
49'\" .DS
50'\" Begin an indented unfilled display.
51'\"
52'\" .DE
53'\" End of indented unfilled display.
54'\"
55'\" .SO
56'\" Start of list of standard options for a Tk widget. The
57'\" options follow on successive lines, in four columns separated
58'\" by tabs.
59'\"
60'\" .SE
61'\" End of list of standard options for a Tk widget.
62'\"
63'\" .OP cmdName dbName dbClass
64'\" Start of description of a specific option. cmdName gives the
65'\" option's name as specified in the class command, dbName gives
66'\" the option's name in the option database, and dbClass gives
67'\" the option's class in the option database.
68'\"
69'\" .UL arg1 arg2
70'\" Print arg1 underlined, then print arg2 normally.
71'\"
72'\" RCS: @(#) $Id: man.macros,v 1.4 2000/08/25 06:18:32 ericm Exp $
73'\"
74'\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
75.if t .wh -1.3i ^B
76.nr ^l \n(.l
77.ad b
78'\" # Start an argument description
79.de AP
80.ie !"\\$4"" .TP \\$4
81.el \{\
82. ie !"\\$2"" .TP \\n()Cu
83. el .TP 15
84.\}
85.ta \\n()Au \\n()Bu
86.ie !"\\$3"" \{\
87\&\\$1 \\fI\\$2\\fP (\\$3)
88.\".b
89.\}
90.el \{\
91.br
92.ie !"\\$2"" \{\
93\&\\$1 \\fI\\$2\\fP
94.\}
95.el \{\
96\&\\fI\\$1\\fP
97.\}
98.\}
99..
100'\" # define tabbing values for .AP
101.de AS
102.nr )A 10n
103.if !"\\$1"" .nr )A \\w'\\$1'u+3n
104.nr )B \\n()Au+15n
105.\"
106.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
107.nr )C \\n()Bu+\\w'(in/out)'u+2n
108..
109.AS Tcl_Interp Tcl_CreateInterp in/out
110'\" # BS - start boxed text
111'\" # ^y = starting y location
112'\" # ^b = 1
113.de BS
114.br
115.mk ^y
116.nr ^b 1u
117.if n .nf
118.if n .ti 0
119.if n \l'\\n(.lu\(ul'
120.if n .fi
121..
122'\" # BE - end boxed text (draw box now)
123.de BE
124.nf
125.ti 0
126.mk ^t
127.ie n \l'\\n(^lu\(ul'
128.el \{\
129.\" Draw four-sided box normally, but don't draw top of
130.\" box if the box started on an earlier page.
131.ie !\\n(^b-1 \{\
132\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
133.\}
134.el \}\
135\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
136.\}
137.\}
138.fi
139.br
140.nr ^b 0
141..
142'\" # VS - start vertical sidebar
143'\" # ^Y = starting y location
144'\" # ^v = 1 (for troff; for nroff this doesn't matter)
145.de VS
146.if !"\\$2"" .br
147.mk ^Y
148.ie n 'mc \s12\(br\s0
149.el .nr ^v 1u
150..
151'\" # VE - end of vertical sidebar
152.de VE
153.ie n 'mc
154.el \{\
155.ev 2
156.nf
157.ti 0
158.mk ^t
159\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
160.sp -1
161.fi
162.ev
163.\}
164.nr ^v 0
165..
166'\" # Special macro to handle page bottom: finish off current
167'\" # box/sidebar if in box/sidebar mode, then invoked standard
168'\" # page bottom macro.
169.de ^B
170.ev 2
171'ti 0
172'nf
173.mk ^t
174.if \\n(^b \{\
175.\" Draw three-sided box if this is the box's first page,
176.\" draw two sides but no top otherwise.
177.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
178.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
179.\}
180.if \\n(^v \{\
181.nr ^x \\n(^tu+1v-\\n(^Yu
182\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
183.\}
184.bp
185'fi
186.ev
187.if \\n(^b \{\
188.mk ^y
189.nr ^b 2
190.\}
191.if \\n(^v \{\
192.mk ^Y
193.\}
194..
195'\" # DS - begin display
196.de DS
197.RS
198.nf
199.sp
200..
201'\" # DE - end display
202.de DE
203.fi
204.RE
205.sp
206..
207'\" # SO - start of list of standard options
208.de SO
209.SH "STANDARD OPTIONS"
210.LP
211.nf
212.ta 5.5c 11c
213.ft B
214..
215'\" # SE - end of list of standard options
216.de SE
217.fi
218.ft R
219.LP
220See the \\fBoptions\\fR manual entry for details on the standard options.
221..
222'\" # OP - start of full description for a single option
223.de OP
224.LP
225.nf
226.ta 4c
227Command-Line Name: \\fB\\$1\\fR
228Database Name: \\fB\\$2\\fR
229Database Class: \\fB\\$3\\fR
230.fi
231.IP
232..
233'\" # CS - begin code excerpt
234.de CS
235.RS
236.nf
237.ta .25i .5i .75i 1i
238..
239'\" # CE - end code excerpt
240.de CE
241.fi
242.RE
243..
244.de UL
245\\$1\l'|0\(ul'\\$2
246..
247.TH entry n 8.3 Tk "Tk Built-In Commands"
248.BS
249'\" Note: do not modify the .SH NAME line immediately below!
250.SH NAME
251entry \- Create and manipulate entry widgets
252.SH SYNOPSIS
253\fBentry\fR \fIpathName \fR?\fIoptions\fR?
254.SO
255\-background \-highlightthickness \-selectbackground
256\-borderwidth \-insertbackground \-selectborderwidth
257\-cursor \-insertborderwidth \-selectforeground
258\-exportselection \-insertofftime \-takefocus
259\-font \-insertontime \-textvariable
260\-foreground \-insertwidth \-xscrollcommand
261\-highlightbackground \-justify
262\-highlightcolor \-relief
263.SE
264.SH "WIDGET-SPECIFIC OPTIONS"
265.VS 8.4
266.OP \-disabledbackground disabledBackground DisabledBackground
267Specifies the background color to use when the entry is disabled. If
268this option is the empty string, the normal background color is used.
269.OP \-disabledforeground disabledForeground DisabledForeground
270Specifies the foreground color to use when the entry is disabled. If
271this option is the empty string, the normal foreground color is used.
272.VE 8.4
273.VS 8.3
274.OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand
275Specifies a script to eval when \fBvalidateCommand\fR returns 0.
276Setting it to {} disables this feature (the default). The best use
277of this option is to set it to \fIbell\fR. See \fBValidation\fR
278below for more information.
279.VE
280.VS 8.4
281.OP \-readonlybackground readonlyBackground ReadonlyBackground
282Specifies the background color to use when the entry is readonly. If
283this option is the empty string, the normal background color is used.
284.VE
285.OP \-show show Show
286If this option is specified, then the true contents of the entry
287are not displayed in the window.
288Instead, each character in the entry's value will be displayed as
289the first character in the value of this option, such as ``*''.
290This is useful, for example, if the entry is to be used to enter
291a password.
292If characters in the entry are selected and copied elsewhere, the
293information copied will be what is displayed, not the true contents
294of the entry.
295.VS 8.4
296.OP \-state state State
297Specifies one of three states for the entry: \fBnormal\fR,
298\fBdisabled\fR, or \fBreadonly\fR. If the entry is readonly, then the
299value may not be changed using widget commands and no insertion cursor
300will be displayed, even if the input focus is in the widget; the
301contents of the widget may still be selected. If the entry is
302disabled, the value may not be changed, no insertion cursor will be
303displayed, the contents will not be selectable, and the entry may
304be displayed in a different color, depending on the values of the
305\fB-disabledforeground\fR and \fB-disabledbackground\fR options.
306.VE 8.4
307.VS 8.3
308.OP \-validate validate Validate
309Specifies the mode in which validation should operate: \fBnone\fR,
310\fBfocus\fR, \fBfocusin\fR, \fBfocusout\fR, \fBkey\fR, or \fBall\fR.
311It defaults to \fBnone\fR. When you want validation, you must explicitly
312state which mode you wish to use. See \fBValidation\fR below for more.
313.OP "\-validatecommand or \-vcmd" validateCommand ValidateCommand
314Specifies a script to eval when you want to validate the input into
315the entry widget. Setting it to {} disables this feature (the default).
316This command must return a valid Tcl boolean value. If it returns 0 (or
317the valid Tcl boolean equivalent) then it means you reject the new edition
318and it will not occur and the \fBinvalidCommand\fR will be evaluated if it
319is set. If it returns 1, then the new edition occurs.
320See \fBValidation\fR below for more information.
321.VE
322.OP \-width width Width
323Specifies an integer value indicating the desired width of the entry window,
324in average-size characters of the widget's font.
325If the value is less than or equal to zero, the widget picks a
326size just large enough to hold its current text.
327.BE
328
329.SH DESCRIPTION
330.PP
331The \fBentry\fR command creates a new window (given by the
332\fIpathName\fR argument) and makes it into an entry widget.
333Additional options, described above, may be specified on the
334command line or in the option database
335to configure aspects of the entry such as its colors, font,
336and relief. The \fBentry\fR command returns its
337\fIpathName\fR argument. At the time this command is invoked,
338there must not exist a window named \fIpathName\fR, but
339\fIpathName\fR's parent must exist.
340.PP
341An entry is a widget that displays a one-line text string and
342allows that string to be edited using widget commands described below, which
343are typically bound to keystrokes and mouse actions.
344When first created, an entry's string is empty.
345A portion of the entry may be selected as described below.
346If an entry is exporting its selection (see the \fBexportSelection\fR
347option), then it will observe the standard X11 protocols for handling the
348selection; entry selections are available as type \fBSTRING\fR.
349Entries also observe the standard Tk rules for dealing with the
350input focus. When an entry has the input focus it displays an
351\fIinsertion cursor\fR to indicate where new characters will be
352inserted.
353.PP
354Entries are capable of displaying strings that are too long to
355fit entirely within the widget's window. In this case, only a
356portion of the string will be displayed; commands described below
357may be used to change the view in the window. Entries use
358the standard \fBxScrollCommand\fR mechanism for interacting with
359scrollbars (see the description of the \fBxScrollCommand\fR option
360for details). They also support scanning, as described below.
361.SH VALIDATION
362.VS 8.3
363.PP
364Validation works by setting the \fBvalidateCommand\fR
365option to a script which will be evaluated according to the \fBvalidate\fR
366option as follows:
367.PP
368.IP \fBnone\fR 10
369Default. This means no validation will occur.
370.IP \fBfocus\fR 10
371\fBvalidateCommand\fR will be called when the entry receives or
372loses focus.
373.IP \fBfocusin\fR 10
374\fBvalidateCommand\fR will be called when the entry receives focus.
375.IP \fBfocusout\fR 10
376\fBvalidateCommand\fR will be called when the entry loses focus.
377.IP \fBkey\fR 10
378\fBvalidateCommand\fR will be called when the entry is edited.
379.IP \fBall\fR 10
380\fBvalidateCommand\fR will be called for all above conditions.
381.PP
382It is possible to perform percent substitutions on the \fBvalidateCommand\fR
383and \fBinvalidCommand\fR,
384just as you would in a \fBbind\fR script. The following substitutions
385are recognized:
386.PP
387.IP \fB%d\fR 5
388Type of action: 1 for \fBinsert\fR, 0 for \fBdelete\fR,
389or -1 for focus, forced or textvariable validation.
390.IP \fB%i\fR 5
391Index of char string to be inserted/deleted, if any, otherwise -1.
392.IP \fB%P\fR 5
393The value of the entry if the edit is allowed. If you are configuring the
394entry widget to have a new textvariable, this will be the value of that
395textvariable.
396.IP \fB%s\fR 5
397The current value of entry prior to editing.
398.IP \fB%S\fR 5
399The text string being inserted/deleted, if any, {} otherwise.
400.IP \fB%v\fR 5
401The type of validation currently set.
402.IP \fB%V\fR 5
403The type of validation that triggered the callback
404(key, focusin, focusout, forced).
405.IP \fB%W\fR 5
406The name of the entry widget.
407.PP
408In general, the \fBtextVariable\fR and \fBvalidateCommand\fR can be
409dangerous to mix. Any problems have been overcome so that using the
410\fBvalidateCommand\fR will not interfere with the traditional behavior of
411the entry widget. Using the \fBtextVariable\fR for read-only purposes will
412never cause problems. The danger comes when you try set the
413\fBtextVariable\fR to something that the \fBvalidateCommand\fR would not
414accept, which causes \fBvalidate\fR to become \fInone\fR (the
415\fBinvalidCommand\fR will not be triggered). The same happens
416when an error occurs evaluating the \fBvalidateCommand\fR.
417.PP
418Primarily, an error will occur when the \fBvalidateCommand\fR or
419\fBinvalidCommand\fR encounters an error in its script while evaluating or
420\fBvalidateCommand\fR does not return a valid Tcl boolean value. The
421\fBvalidate\fR option will also set itself to \fBnone\fR when you edit the
422entry widget from within either the \fBvalidateCommand\fR or the
423\fBinvalidCommand\fR. Such editions will override the one that was being
424validated. If you wish to edit the entry widget (for example set it to {})
425during validation and still have the \fBvalidate\fR option set, you should
426include the command
427.CS
428after idle {%W config -validate %v}
429.CE
430in the \fBvalidateCommand\fR or \fBinvalidCommand\fR (whichever one you
431were editing the entry widget from). It is also recommended to not set an
432associated \fBtextVariable\fR during validation, as that can cause the
433entry widget to become out of sync with the \fBtextVariable\fR.
434.VE
435.SH "WIDGET COMMAND"
436.PP
437The \fBentry\fR command creates a new Tcl command whose
438name is \fIpathName\fR. This command may be used to invoke various
439operations on the widget. It has the following general form:
440.CS
441\fIpathName option \fR?\fIarg arg ...\fR?
442.CE
443\fIOption\fR and the \fIarg\fRs
444determine the exact behavior of the command.
445.PP
446Many of the widget commands for entries take one or more indices as
447arguments. An index specifies a particular character in the entry's
448string, in any of the following ways:
449.TP 12
450\fInumber\fR
451Specifies the character as a numerical index, where 0 corresponds
452to the first character in the string.
453.TP 12
454\fBanchor\fR
455Indicates the anchor point for the selection, which is set with the
456\fBselect from\fR and \fBselect adjust\fR widget commands.
457.TP 12
458\fBend\fR
459Indicates the character just after the last one in the entry's string.
460This is equivalent to specifying a numerical index equal to the length
461of the entry's string.
462.TP 12
463\fBinsert\fR
464Indicates the character adjacent to and immediately following the
465insertion cursor.
466.TP 12
467\fBsel.first\fR
468Indicates the first character in the selection. It is an error to
469use this form if the selection isn't in the entry window.
470.TP 12
471\fBsel.last\fR
472Indicates the character just after the last one in the selection.
473It is an error to use this form if the selection isn't in the
474entry window.
475.TP 12
476\fB@\fInumber\fR
477In this form, \fInumber\fR is treated as an x-coordinate in the
478entry's window; the character spanning that x-coordinate is used.
479For example, ``\fB@0\fR'' indicates the left-most character in the
480window.
481.LP
482Abbreviations may be used for any of the forms above, e.g. ``\fBe\fR''
483or ``\fBsel.f\fR''. In general, out-of-range indices are automatically
484rounded to the nearest legal value.
485.PP
486The following commands are possible for entry widgets:
487.TP
488\fIpathName \fBbbox \fIindex\fR
489Returns a list of four numbers describing the bounding box of the
490character given by \fIindex\fR.
491The first two elements of the list give the x and y coordinates of
492the upper-left corner of the screen area covered by the character
493(in pixels relative to the widget) and the last two elements give
494the width and height of the character, in pixels.
495The bounding box may refer to a region outside the visible area
496of the window.
497.TP
498\fIpathName \fBcget\fR \fIoption\fR
499Returns the current value of the configuration option given
500by \fIoption\fR.
501\fIOption\fR may have any of the values accepted by the \fBentry\fR
502command.
503.TP
504\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
505Query or modify the configuration options of the widget.
506If no \fIoption\fR is specified, returns a list describing all of
507the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
508information on the format of this list). If \fIoption\fR is specified
509with no \fIvalue\fR, then the command returns a list describing the
510one named option (this list will be identical to the corresponding
511sublist of the value returned if no \fIoption\fR is specified). If
512one or more \fIoption\-value\fR pairs are specified, then the command
513modifies the given widget option(s) to have the given value(s); in
514this case the command returns an empty string.
515\fIOption\fR may have any of the values accepted by the \fBentry\fR
516command.
517.TP
518\fIpathName \fBdelete \fIfirst \fR?\fIlast\fR?
519Delete one or more elements of the entry.
520\fIFirst\fR is the index of the first character to delete, and
521\fIlast\fR is the index of the character just after the last
522one to delete.
523If \fIlast\fR isn't specified it defaults to \fIfirst\fR+1,
524i.e. a single character is deleted.
525This command returns an empty string.
526.TP
527\fIpathName \fBget\fR
528Returns the entry's string.
529.TP
530\fIpathName \fBicursor \fIindex\fR
531Arrange for the insertion cursor to be displayed just before the character
532given by \fIindex\fR. Returns an empty string.
533.TP
534\fIpathName \fBindex\fI index\fR
535Returns the numerical index corresponding to \fIindex\fR.
536.TP
537\fIpathName \fBinsert \fIindex string\fR
538Insert the characters of \fIstring\fR just before the character
539indicated by \fIindex\fR. Returns an empty string.
540.TP
541\fIpathName \fBscan\fR \fIoption args\fR
542This command is used to implement scanning on entries. It has
543two forms, depending on \fIoption\fR:
544.RS
545.TP
546\fIpathName \fBscan mark \fIx\fR
547Records \fIx\fR and the current view in the entry window; used in
548conjunction with later \fBscan dragto\fR commands. Typically this
549command is associated with a mouse button press in the widget. It
550returns an empty string.
551.TP
552\fIpathName \fBscan dragto \fIx\fR
553This command computes the difference between its \fIx\fR argument
554and the \fIx\fR argument to the last \fBscan mark\fR command for
555the widget. It then adjusts the view left or right by 10 times the
556difference in x-coordinates. This command is typically associated
557with mouse motion events in the widget, to produce the effect of
558dragging the entry at high speed through the window. The return
559value is an empty string.
560.RE
561.TP
562\fIpathName \fBselection \fIoption arg\fR
563This command is used to adjust the selection within an entry. It
564has several forms, depending on \fIoption\fR:
565.RS
566.TP
567\fIpathName \fBselection adjust \fIindex\fR
568Locate the end of the selection nearest to the character given by
569\fIindex\fR, and adjust that end of the selection to be at \fIindex\fR
570(i.e. including but not going beyond \fIindex\fR). The other
571end of the selection is made the anchor point for future
572\fBselect to\fR commands. If the selection
573isn't currently in the entry, then a new selection is created to
574include the characters between \fIindex\fR and the most recent
575selection anchor point, inclusive.
576Returns an empty string.
577.TP
578\fIpathName \fBselection clear\fR
579Clear the selection if it is currently in this widget. If the
580selection isn't in this widget then the command has no effect.
581Returns an empty string.
582.TP
583\fIpathName \fBselection from \fIindex\fR
584Set the selection anchor point to just before the character
585given by \fIindex\fR. Doesn't change the selection.
586Returns an empty string.
587.TP
588\fIpathName \fBselection present\fR
589Returns 1 if there is are characters selected in the entry,
5900 if nothing is selected.
591.TP
592\fIpathName \fBselection range \fIstart\fR \fIend\fR
593Sets the selection to include the characters starting with
594the one indexed by \fIstart\fR and ending with the one just
595before \fIend\fR.
596If \fIend\fR refers to the same character as \fIstart\fR or an
597earlier one, then the entry's selection is cleared.
598.TP
599\fIpathName \fBselection to \fIindex\fR
600If \fIindex\fR is before the anchor point, set the selection
601to the characters from \fIindex\fR up to but not including
602the anchor point.
603If \fIindex\fR is the same as the anchor point, do nothing.
604If \fIindex\fR is after the anchor point, set the selection
605to the characters from the anchor point up to but not including
606\fIindex\fR.
607The anchor point is determined by the most recent \fBselect from\fR
608or \fBselect adjust\fR command in this widget.
609If the selection isn't in this widget then a new selection is
610created using the most recent anchor point specified for the widget.
611Returns an empty string.
612.RE
613.VS 8.3
614.TP
615\fIpathName \fBvalidate\fR
616This command is used to force an evaluation of the \fBvalidateCommand\fR
617independent of the conditions specified by the \fBvalidate\fR option.
618This is done by temporarily setting the \fBvalidate\fR option to \fBall\fR.
619It returns 0 or 1.
620.VE
621.TP
622\fIpathName \fBxview \fIargs\fR
623This command is used to query and change the horizontal position of the
624text in the widget's window. It can take any of the following
625forms:
626.RS
627.TP
628\fIpathName \fBxview\fR
629Returns a list containing two elements.
630Each element is a real fraction between 0 and 1; together they describe
631the horizontal span that is visible in the window.
632For example, if the first element is .2 and the second element is .6,
63320% of the entry's text is off-screen to the left, the middle 40% is visible
634in the window, and 40% of the text is off-screen to the right.
635These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
636option.
637.TP
638\fIpathName \fBxview\fR \fIindex\fR
639Adjusts the view in the window so that the character given by \fIindex\fR
640is displayed at the left edge of the window.
641.TP
642\fIpathName \fBxview moveto\fI fraction\fR
643Adjusts the view in the window so that the character \fIfraction\fR of the
644way through the text appears at the left edge of the window.
645\fIFraction\fR must be a fraction between 0 and 1.
646.TP
647\fIpathName \fBxview scroll \fInumber what\fR
648This command shifts the view in the window left or right according to
649\fInumber\fR and \fIwhat\fR.
650\fINumber\fR must be an integer.
651\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation
652of one of these.
653If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
654\fInumber\fR average-width characters on the display; if it is
655\fBpages\fR then the view adjusts by \fInumber\fR screenfuls.
656If \fInumber\fR is negative then characters farther to the left
657become visible; if it is positive then characters farther to the right
658become visible.
659.RE
660.SH "DEFAULT BINDINGS"
661.PP
662Tk automatically creates class bindings for entries that give them
663the following default behavior.
664In the descriptions below, ``word'' refers to a contiguous group
665of letters, digits, or ``_'' characters, or any single character
666other than these.
667.IP [1]
668Clicking mouse button 1 positions the insertion cursor
669just before the character underneath the mouse cursor, sets the
670input focus to this widget, and clears any selection in the widget.
671Dragging with mouse button 1 strokes out a selection between
672the insertion cursor and the character under the mouse.
673.IP [2]
674Double-clicking with mouse button 1 selects the word under the mouse
675and positions the insertion cursor at the end of the word.
676Dragging after a double click will stroke out a selection consisting
677of whole words.
678.IP [3]
679Triple-clicking with mouse button 1 selects all of the text in the
680entry and positions the insertion cursor at the end of the line.
681.IP [4]
682The ends of the selection can be adjusted by dragging with mouse
683button 1 while the Shift key is down; this will adjust the end
684of the selection that was nearest to the mouse cursor when button
6851 was pressed.
686If the button is double-clicked before dragging then the selection
687will be adjusted in units of whole words.
688.IP [5]
689Clicking mouse button 1 with the Control key down will position the
690insertion cursor in the entry without affecting the selection.
691.IP [6]
692If any normal printing characters are typed in an entry, they are
693inserted at the point of the insertion cursor.
694.IP [7]
695The view in the entry can be adjusted by dragging with mouse button 2.
696If mouse button 2 is clicked without moving the mouse, the selection
697is copied into the entry at the position of the mouse cursor.
698.IP [8]
699If the mouse is dragged out of the entry on the left or right sides
700while button 1 is pressed, the entry will automatically scroll to
701make more text visible (if there is more text off-screen on the side
702where the mouse left the window).
703.IP [9]
704The Left and Right keys move the insertion cursor one character to the
705left or right; they also clear any selection in the entry and set
706the selection anchor.
707If Left or Right is typed with the Shift key down, then the insertion
708cursor moves and the selection is extended to include the new character.
709Control-Left and Control-Right move the insertion cursor by words, and
710Control-Shift-Left and Control-Shift-Right move the insertion cursor
711by words and also extend the selection.
712Control-b and Control-f behave the same as Left and Right, respectively.
713Meta-b and Meta-f behave the same as Control-Left and Control-Right,
714respectively.
715.IP [10]
716The Home key, or Control-a, will move the insertion cursor to the
717beginning of the entry and clear any selection in the entry.
718Shift-Home moves the insertion cursor to the beginning of the entry
719and also extends the selection to that point.
720.IP [11]
721The End key, or Control-e, will move the insertion cursor to the
722end of the entry and clear any selection in the entry.
723Shift-End moves the cursor to the end and extends the selection
724to that point.
725.IP [12]
726The Select key and Control-Space set the selection anchor to the position
727of the insertion cursor. They don't affect the current selection.
728Shift-Select and Control-Shift-Space adjust the selection to the
729current position of the insertion cursor, selecting from the anchor
730to the insertion cursor if there was not any selection previously.
731.IP [13]
732Control-/ selects all the text in the entry.
733.IP [14]
734Control-\e clears any selection in the entry.
735.IP [15]
736The F16 key (labelled Copy on many Sun workstations) or Meta-w
737copies the selection in the widget to the clipboard, if there is a selection.
738.IP [16]
739The F20 key (labelled Cut on many Sun workstations) or Control-w
740copies the selection in the widget to the clipboard and deletes
741the selection.
742If there is no selection in the widget then these keys have no effect.
743.IP [17]
744The F18 key (labelled Paste on many Sun workstations) or Control-y
745inserts the contents of the clipboard at the position of the
746insertion cursor.
747.IP [18]
748The Delete key deletes the selection, if there is one in the entry.
749If there is no selection, it deletes the character to the right of
750the insertion cursor.
751.IP [19]
752The BackSpace key and Control-h delete the selection, if there is one
753in the entry.
754If there is no selection, it deletes the character to the left of
755the insertion cursor.
756.IP [20]
757Control-d deletes the character to the right of the insertion cursor.
758.IP [21]
759Meta-d deletes the word to the right of the insertion cursor.
760.IP [22]
761Control-k deletes all the characters to the right of the insertion
762cursor.
763.IP [23]
764Control-t reverses the order of the two characters to the right of
765the insertion cursor.
766.PP
767If the entry is disabled using the \fB\-state\fR option, then the entry's
768view can still be adjusted and text in the entry can still be selected,
769but no insertion cursor will be displayed and no text modifications will
770take place
771.VS
772except if the entry is linked to a variable using the \fB\-textvariable\fR
773option, in which case any changes to the variable are reflected by the
774entry whatever the value of its \fB\-state\fR option.
775.VE
776.PP
777The behavior of entries can be changed by defining new bindings for
778individual widgets or by redefining the class bindings.
779
780.SH KEYWORDS
781entry, widget