Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Tk::Entry.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "ENTRY 1"
132.TH ENTRY 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134Tk::Entry \- Create and manipulate Entry widgets
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137\&\ \fI$entry\fR = \fI$parent\fR\->\fBEntry\fR(?\fIoptions\fR?);
138.SH "STANDARD OPTIONS"
139.IX Header "STANDARD OPTIONS"
140\&\fB\-background\fR \fB\-highlightbackground\fR \fB\-insertontime\fR \fB\-selectforeground\fR
141\&\fB\-borderwidth\fR \fB\-highlightcolor\fR \fB\-insertwidth\fR \fB\-takefocus\fR
142\&\fB\-cursor\fR \fB\-highlightthickness\fR \fB\-justify\fR \fB\-textvariable\fR
143\&\fB\-exportselection\fR \fB\-insertbackground\fR \fB\-relief\fR \fB\-xscrollcommand\fR
144\&\fB\-font\fR \fB\-insertborderwidth\fR \fB\-selectbackground\fR
145\&\fB\-foreground\fR \fB\-insertofftime\fR \fB\-selectborderwidth\fR
146.SH "WIDGET-SPECIFIC OPTIONS"
147.IX Header "WIDGET-SPECIFIC OPTIONS"
148.IP "Name: \fBinvalidCommand\fR" 4
149.IX Item "Name: invalidCommand"
150.PD 0
151.IP "Class: \fBInvalidCommand\fR" 4
152.IX Item "Class: InvalidCommand"
153.IP "Switch: \fB\-invalidcommand\fR" 4
154.IX Item "Switch: -invalidcommand"
155.IP "Alias: \fB\-invcmd\fR" 4
156.IX Item "Alias: -invcmd"
157.PD
158Specifies a script to eval when \fBvalidateCommand\fR returns 0.
159Setting it to <undef> disables this feature (the default). The best use
160of this option is to set it to \fIbell\fR. See \fBValidation\fR
161below for more information.
162.IP "Name: \fBshow\fR" 4
163.IX Item "Name: show"
164.PD 0
165.IP "Class: \fBShow\fR" 4
166.IX Item "Class: Show"
167.IP "Switch: \fB\-show\fR" 4
168.IX Item "Switch: -show"
169.PD
170If this option is specified, then the true contents of the entry
171are not displayed in the window.
172Instead, each character in the entry's value will be displayed as
173the first character in the value of this option, such as ``*''.
174This is useful, for example, if the entry is to be used to enter
175a password.
176If characters in the entry are selected and copied elsewhere, the
177information copied will be what is displayed, not the true contents
178of the entry.
179.IP "Name: \fBstate\fR" 4
180.IX Item "Name: state"
181.PD 0
182.IP "Class: \fBState\fR" 4
183.IX Item "Class: State"
184.IP "Switch: \fB\-state\fR" 4
185.IX Item "Switch: -state"
186.PD
187Specifies one of two states for the entry: \fBnormal\fR or \fBdisabled\fR.
188If the entry is disabled then the value may not be changed using widget
189methods and no insertion cursor will be displayed, even if the input focus is
190in the widget.
191.IP "Name: \fBvalidate\fR" 4
192.IX Item "Name: validate"
193.PD 0
194.IP "Class: \fBValidate\fR" 4
195.IX Item "Class: Validate"
196.IP "Switch: \fB\-validate\fR" 4
197.IX Item "Switch: -validate"
198.PD
199Specifies the mode in which validation should operate: \fBnone\fR,
200\&\fBfocus\fR, \fBfocusin\fR, \fBfocusout\fR, \fBkey\fR, or \fBall\fR.
201It defaults to \fBnone\fR. When you want validation, you must explicitly
202state which mode you wish to use. See \fBValidation\fR below for more.
203.IP "Name: \fBvalidateCommand\fR" 4
204.IX Item "Name: validateCommand"
205.PD 0
206.IP "Class: \fBValidateCommand\fR" 4
207.IX Item "Class: ValidateCommand"
208.IP "Switch: \fB\-validatecommand\fR" 4
209.IX Item "Switch: -validatecommand"
210.IP "Alias: \fB\-vcmd\fR" 4
211.IX Item "Alias: -vcmd"
212.PD
213Specifies a script to eval when you want to validate the input into
214the entry widget. Setting it to \f(CW\*(C`undef\*(C'\fR disables this feature (the default).
215This command must return a valid boolean value. If it returns 0 (or
216the valid boolean equivalent) then it means you reject the new edition
217and it will not occur and the \fBinvalidCommand\fR will be evaluated if it
218is set. If it returns 1, then the new edition occurs.
219See \fBValidation\fR below for more information.
220.IP "Name: \fBwidth\fR" 4
221.IX Item "Name: width"
222.PD 0
223.IP "Class: \fBWidth\fR" 4
224.IX Item "Class: Width"
225.IP "Switch: \fB\-width\fR" 4
226.IX Item "Switch: -width"
227.PD
228Specifies an integer value indicating the desired width of the entry window,
229in average-size characters of the widget's font.
230If the value is less than or equal to zero, the widget picks a
231size just large enough to hold its current text.
232.SH "DESCRIPTION"
233.IX Header "DESCRIPTION"
234The \fBEntry\fR method creates a new window (given by the
235\&\f(CW$entry\fR argument) and makes it into an entry widget.
236Additional options, described above, may be specified on the
237command line or in the option database
238to configure aspects of the entry such as its colors, font,
239and relief. The \fBentry\fR command returns its
240\&\f(CW$entry\fR argument. At the time this command is invoked,
241there must not exist a window named \f(CW$entry\fR, but
242\&\f(CW$entry\fR's parent must exist.
243.PP
244An entry is a widget that displays a one-line text string and
245allows that string to be edited using methods described below, which
246are typically bound to keystrokes and mouse actions.
247When first created, an entry's string is empty.
248A portion of the entry may be selected as described below.
249If an entry is exporting its selection (see the \fBexportSelection\fR
250option), then it will observe the standard X11 protocols for handling the
251selection; entry selections are available as type \fB\s-1STRING\s0\fR.
252Entries also observe the standard Tk rules for dealing with the
253input focus. When an entry has the input focus it displays an
254\&\fIinsertion cursor\fR to indicate where new characters will be
255inserted.
256.PP
257Entries are capable of displaying strings that are too long to
258fit entirely within the widget's window. In this case, only a
259portion of the string will be displayed; methods described below
260may be used to change the view in the window. Entries use
261the standard \fBxScrollCommand\fR mechanism for interacting with
262scrollbars (see the description of the \fB\-xscrollcommand\fR option
263for details). They also support scanning, as described below.
264.SH "VALIDATION"
265.IX Header "VALIDATION"
266Validation of entry widgets is derived from part of the patch written by
267jhobbs@cs.uoregon.edu. This works by setting the \fBvalidateCommand\fR
268option to a callback which will be evaluated according to the \fBvalidate\fR
269option as follows:
270.IP "\fBnone\fR" 4
271.IX Item "none"
272Default. This means no validation will occur.
273.IP "\fBfocus\fR" 4
274.IX Item "focus"
275\&\fBvalidateCommand\fR will be called when the entry receives or
276loses focus.
277.IP "\fBfocusin\fR" 4
278.IX Item "focusin"
279\&\fBvalidateCommand\fR will be called when the entry receives focus.
280.IP "\fBfocusout\fR" 4
281.IX Item "focusout"
282\&\fBvalidateCommand\fR will be called when the entry loses focus.
283.IP "\fBkey\fR" 4
284.IX Item "key"
285\&\fBvalidateCommand\fR will be called when the entry is edited.
286.IP "\fBall\fR" 4
287.IX Item "all"
288\&\fBvalidateCommand\fR will be called for all above conditions.
289.PP
290The \fBvalidateCommand\fR and \fBinvalidCommand\fR are called with the following
291arguments:
292.IP "\(bu The proposed value of the entry. If you are configuring the entry widget to have a new textvariable, this will be the value of that textvariable." 4
293.IX Item "The proposed value of the entry. If you are configuring the entry widget to have a new textvariable, this will be the value of that textvariable."
294.PD 0
295.ie n .IP "\(bu The characters to be added (or deleted). This will be ""undef""\fR if validation is due to focus, explcit call to validate or if change is due to \f(CW""\-textvariable"" changing." 4
296.el .IP "\(bu The characters to be added (or deleted). This will be \f(CWundef\fR if validation is due to focus, explcit call to validate or if change is due to \f(CW\-textvariable\fR changing." 4
297.IX Item "The characters to be added (or deleted). This will be undef if validation is due to focus, explcit call to validate or if change is due to -textvariable changing."
298.IP "\(bu The current value of entry i.e. before the proposed change." 4
299.IX Item "The current value of entry i.e. before the proposed change."
300.IP "\(bu index of char string to be added/deleted, if any. \-1 otherwise" 4
301.IX Item "index of char string to be added/deleted, if any. -1 otherwise"
302.IP "\(bu type of action. 1 == \s-1INSERT\s0, 0 == \s-1DELETE\s0, \-1 if it's a forced validation or textvariable validation" 4
303.IX Item "type of action. 1 == INSERT, 0 == DELETE, -1 if it's a forced validation or textvariable validation"
304.PD
305.PP
306In general, the \fBtextVariable\fR and \fBvalidateCommand\fR can be
307dangerous to mix. If you try set the \fBtextVariable\fR
308to something that the \fBvalidateCommand\fR will not accept it will
309be set back to the value of the entry widget.
310Using the \fBtextVariable\fR for read-only purposes will never cause problems.
311.PP
312The \fBvalidateCommand\fR will turn itself off by setting
313\&\fBvalidate\fR to \fBnone\fR when an error occurs, for example
314when the \fBvalidateCommand\fR or \fBinvalidCommand\fR encounters
315an error in its script while evaluating, or
316\&\fBvalidateCommand\fR does not return a valid boolean value.
317.PP
318With the perl/Tk version \fBvalidate\fR option is supposed to be
319\&\*(L"suspended\*(R" while executing the \fBvalidateCommand\fR or the \fBinvalidCommand\fR.
320This is experimental but in theory either callback can \*(L"correct\*(R" the
321value of the widget, and override the proposed change. (\fBvalidateCommand\fR
322should still return false to inhibit the change from happening when
323it returns.)
324.SH "WIDGET METHODS"
325.IX Header "WIDGET METHODS"
326The \fBEntry\fR method creates a widget object.
327This object supports the \fBconfigure\fR and \fBcget\fR methods
328described in Tk::options which can be used to enquire and
329modify the options described above.
330The widget also inherits all the methods provided by the generic
331Tk::Widget class.
332.PP
333Many of the additional methods for entries take one or more indices as
334arguments. An index specifies a particular character in the entry's
335string, in any of the following ways:
336.IP "\fInumber\fR" 4
337.IX Item "number"
338Specifies the character as a numerical index, where 0 corresponds
339to the first character in the string.
340.IP "\fBanchor\fR" 4
341.IX Item "anchor"
342Indicates the anchor point for the selection, which is set with the
343\&\fBselectionFrom\fR and \fBselectionAdjust\fR methods.
344.IP "\fBend\fR" 4
345.IX Item "end"
346Indicates the character just after the last one in the entry's string.
347This is equivalent to specifying a numerical index equal to the length
348of the entry's string.
349.IP "\fBinsert\fR" 4
350.IX Item "insert"
351Indicates the character adjacent to and immediately following the
352insertion cursor.
353.IP "\fBsel.first\fR" 4
354.IX Item "sel.first"
355Indicates the first character in the selection. It is an error to
356use this form if the selection isn't in the entry window.
357.IP "\fBsel.last\fR" 4
358.IX Item "sel.last"
359Indicates the character just after the last one in the selection.
360It is an error to use this form if the selection isn't in the
361entry window.
362.IP "\fB@\fR\fInumber\fR" 4
363.IX Item "@number"
364In this form, \fInumber\fR is treated as an x\-coordinate in the
365entry's window; the character spanning that x\-coordinate is used.
366For example, ``\fB@0\fR'' indicates the left-most character in the
367window.
368.PP
369Abbreviations may be used for any of the forms above, e.g. ``\fBe\fR''
370or ``\fBsel.f\fR''. In general, out-of-range indices are automatically
371rounded to the nearest legal value.
372.PP
373The following additional methods are available for entry widgets:
374.IP "\fI$entry\fR\->\fBbbox\fR(\fIindex\fR)" 4
375.IX Item "$entry->bbox(index)"
376Returns a list of four numbers describing the bounding box of the
377character given by \fIindex\fR.
378The first two elements of the list give the x and y coordinates of
379the upper-left corner of the screen area covered by the character
380(in pixels relative to the widget) and the last two elements give
381the width and height of the character, in pixels.
382The bounding box may refer to a region outside the visible area
383of the window.
384.IP "\fI$entry\fR\->\fBdelete\fR(\fIfirst, \fR?\fIlast\fR?)" 4
385.IX Item "$entry->delete(first, ?last?)"
386Returns the current value of the configuration option given
387by \fIoption\fR.
388\&\fIOption\fR may have any of the values accepted by the \fBentry\fR
389command.
390.IP "\fI$entry\fR\->\fBconfigure\fR(?\fIoption\fR?, ?\fIvalue, option, value, ...\fR?)" 4
391.IX Item "$entry->configure(?option?, ?value, option, value, ...?)"
392Query or modify the configuration options of the widget.
393If no \fIoption\fR is specified, returns a list describing all of
394the available options for \f(CW$entry\fR (see Tk::configure for
395information on the format of this list). If \fIoption\fR is specified
396with no \fIvalue\fR, then the command returns a list describing the
397one named option (this list will be identical to the corresponding
398sublist of the value returned if no \fIoption\fR is specified). If
399one or more \fIoption-value\fR pairs are specified, then the command
400modifies the given widget option(s) to have the given value(s); in
401this case the command returns an empty string.
402\&\fIOption\fR may have any of the values accepted by the \fBentry\fR
403command.
404.IP "\fI$entry\fR\->\fBdelete\fR(\fIfirst, \fR?\fIlast\fR?)" 4
405.IX Item "$entry->delete(first, ?last?)"
406Delete one or more elements of the entry.
407\&\fIFirst\fR is the index of the first character to delete, and
408\&\fIlast\fR is the index of the character just after the last
409one to delete.
410If \fIlast\fR isn't specified it defaults to \fIfirst\fR+1,
411i.e. a single character is deleted.
412This method returns an empty string.
413.IP "\fI$entry\fR\->\fBget\fR" 4
414.IX Item "$entry->get"
415Returns the entry's string.
416.IP "\fI$entry\fR\->\fBicursor\fR(\fIindex\fR)" 4
417.IX Item "$entry->icursor(index)"
418Arrange for the insertion cursor to be displayed just before the character
419given by \fIindex\fR. Returns an empty string.
420.IP "\fI$entry\fR\->\fBindex\fR(\fIindex\fR)" 4
421.IX Item "$entry->index(index)"
422Returns the numerical index corresponding to \fIindex\fR.
423.IP "\fI$entry\fR\->\fBinsert\fR(\fIindex, string\fR)" 4
424.IX Item "$entry->insert(index, string)"
425Insert the characters of \fIstring\fR just before the character
426indicated by \fIindex\fR. Returns an empty string.
427.IP "\fI$entry\fR\->\fBscan\fR(\fIoption, args\fR)" 4
428.IX Item "$entry->scan(option, args)"
429.PD 0
430.IP "\fI$entry\fR\->\fBscan\fR\fIOption\fR(\fIargs\fR)" 4
431.IX Item "$entry->scanOption(args)"
432.PD
433This method is used to implement scanning on entries. It has
434two forms, depending on \fIOption\fR:
435.RS 4
436.IP "\fI$entry\fR\->\fBscanMark\fR(\fIx\fR)" 8
437.IX Item "$entry->scanMark(x)"
438Records \fIx\fR and the current view in the entry widget; used in
439conjunction with later \fBscanDragto\fR methods. Typically this
440method is associated with a mouse button press in the widget. It
441returns an empty string.
442.IP "\fI$entry\fR\->\fBscanDragto\fR(\fIx\fR)" 8
443.IX Item "$entry->scanDragto(x)"
444This method computes the difference between its \fIx\fR argument
445and the \fIx\fR argument to the last \fBscanMark\fR method for
446the widget. It then adjusts the view left or right by 10 times the
447difference in x\-coordinates. This method is typically associated
448with mouse motion events in the widget, to produce the effect of
449dragging the entry at high speed through the widget. The return
450value is an empty string.
451.RE
452.RS 4
453.RE
454.IP "\fI$entry\fR\->\fBselection\fR(\fIoption, arg\fR)" 4
455.IX Item "$entry->selection(option, arg)"
456.PD 0
457.IP "\fI$entry\fR\->\fBselection\fR\fIOption\fR(\fIarg\fR)" 4
458.IX Item "$entry->selectionOption(arg)"
459.PD
460This method is used to adjust the selection within an entry. It
461has several forms, depending on \fIOption\fR:
462.RS 4
463.IP "\fI$entry\fR\->\fBselectionAdjust\fR(\fIindex\fR)" 8
464.IX Item "$entry->selectionAdjust(index)"
465Locate the end of the selection nearest to the character given by
466\&\fIindex\fR, and adjust that end of the selection to be at \fIindex\fR
467(i.e including but not going beyond \fIindex\fR). The other
468end of the selection is made the anchor point for future
469\&\fBselectionTo\fR methods. If the selection
470isn't currently in the entry, then a new selection is created to
471include the characters between \fIindex\fR and the most recent
472selection anchor point, inclusive.
473Returns an empty string.
474.IP "\fI$entry\fR\->\fBselectionClear\fR" 8
475.IX Item "$entry->selectionClear"
476Clear the selection if it is currently in this widget. If the
477selection isn't in this widget then the method has no effect.
478Returns an empty string.
479.IP "\fI$entry\fR\->\fBselectionFrom\fR(\fIindex\fR)" 8
480.IX Item "$entry->selectionFrom(index)"
481Set the selection anchor point to just before the character
482given by \fIindex\fR. Doesn't change the selection.
483Returns an empty string.
484.IP "\fI$entry\fR\->\fBselectionPresent\fR" 8
485.IX Item "$entry->selectionPresent"
486Returns 1 if there is are characters selected in the entry,
4870 if nothing is selected.
488.IP "\fI$entry\fR\->\fBselectionRange\fR(\fIstart, \fR\fIend\fR)" 8
489.IX Item "$entry->selectionRange(start, end)"
490Sets the selection to include the characters starting with
491the one indexed by \fIstart\fR and ending with the one just
492before \fIend\fR.
493If \fIend\fR refers to the same character as \fIstart\fR or an
494earlier one, then the entry's selection is cleared.
495.IP "\fI$entry\fR\->\fBselectionTo\fR(\fIindex\fR)" 8
496.IX Item "$entry->selectionTo(index)"
497If \fIindex\fR is before the anchor point, set the selection
498to the characters from \fIindex\fR up to but not including
499the anchor point.
500If \fIindex\fR is the same as the anchor point, do nothing.
501If \fIindex\fR is after the anchor point, set the selection
502to the characters from the anchor point up to but not including
503\&\fIindex\fR.
504The anchor point is determined by the most recent \fBselectionFrom\fR
505or \fBselectionAdjust\fR method in this widget.
506If the selection isn't in this widget then a new selection is
507created using the most recent anchor point specified for the widget.
508Returns an empty string.
509.RE
510.RS 4
511.RE
512.IP "\fI$entry\fR\->\fBvalidate\fR" 4
513.IX Item "$entry->validate"
514This command is used to force an evaluation of the \fBvalidateCommand\fR
515independent of the conditions specified by the \fBvalidate\fR option. It
516returns 0 or 1.
517.IP "\fI$entry\fR\->\fBxview\fR(\fIargs\fR)" 4
518.IX Item "$entry->xview(args)"
519This command is used to query and change the horizontal position of the
520text in the widget's window. It can take any of the following
521forms:
522.RS 4
523.IP "\fI$entry\fR\->\fBxview\fR" 8
524.IX Item "$entry->xview"
525Returns a list containing two elements.
526Each element is a real fraction between 0 and 1; together they describe
527the horizontal span that is visible in the window.
528For example, if the first element is .2 and the second element is .7,
52920% of the entry's text is off-screen to the left, the middle 50% is visible
530in the window, and 30% of the text is off-screen to the right.
531These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
532option.
533.IP "\fI$entry\fR\->\fBxview\fR(\fIindex\fR)" 8
534.IX Item "$entry->xview(index)"
535Adjusts the view in the window so that the character given by \fIindex\fR
536is displayed at the left edge of the window.
537.IP "\fI$entry\fR\->\fBxviewMoveto\fR(\fIfraction\fR)" 8
538.IX Item "$entry->xviewMoveto(fraction)"
539Adjusts the view in the window so that the character \fIfraction\fR of the
540way through the text appears at the left edge of the window.
541\&\fIFraction\fR must be a fraction between 0 and 1.
542.IP "\fI$entry\fR\->\fBxviewScroll\fR(\fInumber, what\fR)" 8
543.IX Item "$entry->xviewScroll(number, what)"
544This method shifts the view in the window left or right according to
545\&\fInumber\fR and \fIwhat\fR.
546\&\fINumber\fR must be an integer.
547\&\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation
548of one of these.
549If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
550\&\fInumber\fR average-width characters on the display; if it is
551\&\fBpages\fR then the view adjusts by \fInumber\fR screenfuls.
552If \fInumber\fR is negative then characters farther to the left
553become visible; if it is positive then characters farther to the right
554become visible.
555.RE
556.RS 4
557.SH "DEFAULT BINDINGS"
558.IX Header "DEFAULT BINDINGS"
559Tk automatically creates class bindings for entries that give them
560the following default behavior.
561In the descriptions below, ``word'' refers to a contiguous group
562of letters, digits, or ``_'' characters, or any single character
563other than these.
564.IP "[1]" 4
565.IX Item "[1]"
566Clicking mouse button 1 positions the insertion cursor
567just before the character underneath the mouse cursor, sets the
568input focus to this widget, and clears any selection in the widget.
569Dragging with mouse button 1 strokes out a selection between
570the insertion cursor and the character under the mouse.
571.IP "[2]" 4
572.IX Item "[2]"
573Double-clicking with mouse button 1 selects the word under the mouse
574and positions the insertion cursor at the beginning of the word.
575Dragging after a double click will stroke out a selection consisting
576of whole words.
577.IP "[3]" 4
578.IX Item "[3]"
579Triple-clicking with mouse button 1 selects all of the text in the
580entry and positions the insertion cursor before the first character.
581.IP "[4]" 4
582.IX Item "[4]"
583The ends of the selection can be adjusted by dragging with mouse
584button 1 while the Shift key is down; this will adjust the end
585of the selection that was nearest to the mouse cursor when button
5861 was pressed.
587If the button is double-clicked before dragging then the selection
588will be adjusted in units of whole words.
589.IP "[5]" 4
590.IX Item "[5]"
591Clicking mouse button 1 with the Control key down will position the
592insertion cursor in the entry without affecting the selection.
593.IP "[6]" 4
594.IX Item "[6]"
595If any normal printing characters are typed in an entry, they are
596inserted at the point of the insertion cursor.
597.IP "[7]" 4
598.IX Item "[7]"
599The view in the entry can be adjusted by dragging with mouse button 2.
600If mouse button 2 is clicked without moving the mouse, the selection
601is copied into the entry at the position of the mouse cursor.
602.IP "[8]" 4
603.IX Item "[8]"
604If the mouse is dragged out of the entry on the left or right sides
605while button 1 is pressed, the entry will automatically scroll to
606make more text visible (if there is more text off-screen on the side
607where the mouse left the window).
608.IP "[9]" 4
609.IX Item "[9]"
610The Left and Right keys move the insertion cursor one character to the
611left or right; they also clear any selection in the entry and set
612the selection anchor.
613If Left or Right is typed with the Shift key down, then the insertion
614cursor moves and the selection is extended to include the new character.
615Control-Left and Control-Right move the insertion cursor by words, and
616Control-Shift-Left and Control-Shift-Right move the insertion cursor
617by words and also extend the selection.
618Control-b and Control-f behave the same as Left and Right, respectively.
619Meta-b and Meta-f behave the same as Control-Left and Control\-Right,
620respectively.
621.IP "[10]" 4
622.IX Item "[10]"
623The Home key, or Control\-a, will move the insertion cursor to the
624beginning of the entry and clear any selection in the entry.
625Shift-Home moves the insertion cursor to the beginning of the entry
626and also extends the selection to that point.
627.IP "[11]" 4
628.IX Item "[11]"
629The End key, or Control\-e, will move the insertion cursor to the
630end of the entry and clear any selection in the entry.
631Shift-End moves the cursor to the end and extends the selection
632to that point.
633.IP "[12]" 4
634.IX Item "[12]"
635The Select key and Control-Space set the selection anchor to the position
636of the insertion cursor. They don't affect the current selection.
637Shift-Select and Control-Shift-Space adjust the selection to the
638current position of the insertion cursor, selecting from the anchor
639to the insertion cursor if there was not any selection previously.
640.IP "[13]" 4
641.IX Item "[13]"
642Control\-/ selects all the text in the entry.
643.IP "[14]" 4
644.IX Item "[14]"
645Control\-\e clears any selection in the entry.
646.IP "[15]" 4
647.IX Item "[15]"
648The F16 key (labelled Copy on many Sun workstations) or Meta-w
649copies the selection in the widget to the clipboard, if there is a selection.
650.IP "[16]" 4
651.IX Item "[16]"
652The F20 key (labelled Cut on many Sun workstations) or Control-w
653copies the selection in the widget to the clipboard and deletes
654the selection.
655If there is no selection in the widget then these keys have no effect.
656.IP "[17]" 4
657.IX Item "[17]"
658The F18 key (labelled Paste on many Sun workstations) or Control-y
659inserts the contents of the clipboard at the position of the
660insertion cursor.
661.IP "[18]" 4
662.IX Item "[18]"
663The Delete key deletes the selection, if there is one in the entry.
664If there is no selection, it deletes the character to the right of
665the insertion cursor.
666.IP "[19]" 4
667.IX Item "[19]"
668The BackSpace key and Control-h delete the selection, if there is one
669in the entry.
670If there is no selection, it deletes the character to the left of
671the insertion cursor.
672.IP "[20]" 4
673.IX Item "[20]"
674Control-d deletes the character to the right of the insertion cursor.
675.IP "[21]" 4
676.IX Item "[21]"
677Meta-d deletes the word to the right of the insertion cursor.
678.IP "[22]" 4
679.IX Item "[22]"
680Control-k deletes all the characters to the right of the insertion
681cursor.
682.IP "[23]" 4
683.IX Item "[23]"
684Control-t reverses the order of the two characters to the right of
685the insertion cursor.
686.Sp
687If the entry is disabled using the \fB\-state\fR option, then the entry's
688view can still be adjusted and text in the entry can still be selected,
689but no insertion cursor will be displayed and no text modifications will
690take place.
691.Sp
692The behavior of entries can be changed by defining new bindings for
693individual widgets or by redefining the class bindings.
694.RE
695.RS 4
696.SH "KEYWORDS"
697.IX Header "KEYWORDS"
698entry, widget