Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Tk::Entry.3
.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "ENTRY 1"
.TH ENTRY 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation"
.SH "NAME"
Tk::Entry \- Create and manipulate Entry widgets
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\ \fI$entry\fR = \fI$parent\fR\->\fBEntry\fR(?\fIoptions\fR?);
.SH "STANDARD OPTIONS"
.IX Header "STANDARD OPTIONS"
\&\fB\-background\fR \fB\-highlightbackground\fR \fB\-insertontime\fR \fB\-selectforeground\fR
\&\fB\-borderwidth\fR \fB\-highlightcolor\fR \fB\-insertwidth\fR \fB\-takefocus\fR
\&\fB\-cursor\fR \fB\-highlightthickness\fR \fB\-justify\fR \fB\-textvariable\fR
\&\fB\-exportselection\fR \fB\-insertbackground\fR \fB\-relief\fR \fB\-xscrollcommand\fR
\&\fB\-font\fR \fB\-insertborderwidth\fR \fB\-selectbackground\fR
\&\fB\-foreground\fR \fB\-insertofftime\fR \fB\-selectborderwidth\fR
.SH "WIDGET-SPECIFIC OPTIONS"
.IX Header "WIDGET-SPECIFIC OPTIONS"
.IP "Name: \fBinvalidCommand\fR" 4
.IX Item "Name: invalidCommand"
.PD 0
.IP "Class: \fBInvalidCommand\fR" 4
.IX Item "Class: InvalidCommand"
.IP "Switch: \fB\-invalidcommand\fR" 4
.IX Item "Switch: -invalidcommand"
.IP "Alias: \fB\-invcmd\fR" 4
.IX Item "Alias: -invcmd"
.PD
Specifies a script to eval when \fBvalidateCommand\fR returns 0.
Setting it to <undef> disables this feature (the default). The best use
of this option is to set it to \fIbell\fR. See \fBValidation\fR
below for more information.
.IP "Name: \fBshow\fR" 4
.IX Item "Name: show"
.PD 0
.IP "Class: \fBShow\fR" 4
.IX Item "Class: Show"
.IP "Switch: \fB\-show\fR" 4
.IX Item "Switch: -show"
.PD
If this option is specified, then the true contents of the entry
are not displayed in the window.
Instead, each character in the entry's value will be displayed as
the first character in the value of this option, such as ``*''.
This is useful, for example, if the entry is to be used to enter
a password.
If characters in the entry are selected and copied elsewhere, the
information copied will be what is displayed, not the true contents
of the entry.
.IP "Name: \fBstate\fR" 4
.IX Item "Name: state"
.PD 0
.IP "Class: \fBState\fR" 4
.IX Item "Class: State"
.IP "Switch: \fB\-state\fR" 4
.IX Item "Switch: -state"
.PD
Specifies one of two states for the entry: \fBnormal\fR or \fBdisabled\fR.
If the entry is disabled then the value may not be changed using widget
methods and no insertion cursor will be displayed, even if the input focus is
in the widget.
.IP "Name: \fBvalidate\fR" 4
.IX Item "Name: validate"
.PD 0
.IP "Class: \fBValidate\fR" 4
.IX Item "Class: Validate"
.IP "Switch: \fB\-validate\fR" 4
.IX Item "Switch: -validate"
.PD
Specifies the mode in which validation should operate: \fBnone\fR,
\&\fBfocus\fR, \fBfocusin\fR, \fBfocusout\fR, \fBkey\fR, or \fBall\fR.
It defaults to \fBnone\fR. When you want validation, you must explicitly
state which mode you wish to use. See \fBValidation\fR below for more.
.IP "Name: \fBvalidateCommand\fR" 4
.IX Item "Name: validateCommand"
.PD 0
.IP "Class: \fBValidateCommand\fR" 4
.IX Item "Class: ValidateCommand"
.IP "Switch: \fB\-validatecommand\fR" 4
.IX Item "Switch: -validatecommand"
.IP "Alias: \fB\-vcmd\fR" 4
.IX Item "Alias: -vcmd"
.PD
Specifies a script to eval when you want to validate the input into
the entry widget. Setting it to \f(CW\*(C`undef\*(C'\fR disables this feature (the default).
This command must return a valid boolean value. If it returns 0 (or
the valid boolean equivalent) then it means you reject the new edition
and it will not occur and the \fBinvalidCommand\fR will be evaluated if it
is set. If it returns 1, then the new edition occurs.
See \fBValidation\fR below for more information.
.IP "Name: \fBwidth\fR" 4
.IX Item "Name: width"
.PD 0
.IP "Class: \fBWidth\fR" 4
.IX Item "Class: Width"
.IP "Switch: \fB\-width\fR" 4
.IX Item "Switch: -width"
.PD
Specifies an integer value indicating the desired width of the entry window,
in average-size characters of the widget's font.
If the value is less than or equal to zero, the widget picks a
size just large enough to hold its current text.
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fBEntry\fR method creates a new window (given by the
\&\f(CW$entry\fR argument) and makes it into an entry widget.
Additional options, described above, may be specified on the
command line or in the option database
to configure aspects of the entry such as its colors, font,
and relief. The \fBentry\fR command returns its
\&\f(CW$entry\fR argument. At the time this command is invoked,
there must not exist a window named \f(CW$entry\fR, but
\&\f(CW$entry\fR's parent must exist.
.PP
An entry is a widget that displays a one-line text string and
allows that string to be edited using methods described below, which
are typically bound to keystrokes and mouse actions.
When first created, an entry's string is empty.
A portion of the entry may be selected as described below.
If an entry is exporting its selection (see the \fBexportSelection\fR
option), then it will observe the standard X11 protocols for handling the
selection; entry selections are available as type \fB\s-1STRING\s0\fR.
Entries also observe the standard Tk rules for dealing with the
input focus. When an entry has the input focus it displays an
\&\fIinsertion cursor\fR to indicate where new characters will be
inserted.
.PP
Entries are capable of displaying strings that are too long to
fit entirely within the widget's window. In this case, only a
portion of the string will be displayed; methods described below
may be used to change the view in the window. Entries use
the standard \fBxScrollCommand\fR mechanism for interacting with
scrollbars (see the description of the \fB\-xscrollcommand\fR option
for details). They also support scanning, as described below.
.SH "VALIDATION"
.IX Header "VALIDATION"
Validation of entry widgets is derived from part of the patch written by
jhobbs@cs.uoregon.edu. This works by setting the \fBvalidateCommand\fR
option to a callback which will be evaluated according to the \fBvalidate\fR
option as follows:
.IP "\fBnone\fR" 4
.IX Item "none"
Default. This means no validation will occur.
.IP "\fBfocus\fR" 4
.IX Item "focus"
\&\fBvalidateCommand\fR will be called when the entry receives or
loses focus.
.IP "\fBfocusin\fR" 4
.IX Item "focusin"
\&\fBvalidateCommand\fR will be called when the entry receives focus.
.IP "\fBfocusout\fR" 4
.IX Item "focusout"
\&\fBvalidateCommand\fR will be called when the entry loses focus.
.IP "\fBkey\fR" 4
.IX Item "key"
\&\fBvalidateCommand\fR will be called when the entry is edited.
.IP "\fBall\fR" 4
.IX Item "all"
\&\fBvalidateCommand\fR will be called for all above conditions.
.PP
The \fBvalidateCommand\fR and \fBinvalidCommand\fR are called with the following
arguments:
.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
.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."
.PD 0
.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
.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
.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."
.IP "\(bu The current value of entry i.e. before the proposed change." 4
.IX Item "The current value of entry i.e. before the proposed change."
.IP "\(bu index of char string to be added/deleted, if any. \-1 otherwise" 4
.IX Item "index of char string to be added/deleted, if any. -1 otherwise"
.IP "\(bu type of action. 1 == \s-1INSERT\s0, 0 == \s-1DELETE\s0, \-1 if it's a forced validation or textvariable validation" 4
.IX Item "type of action. 1 == INSERT, 0 == DELETE, -1 if it's a forced validation or textvariable validation"
.PD
.PP
In general, the \fBtextVariable\fR and \fBvalidateCommand\fR can be
dangerous to mix. If you try set the \fBtextVariable\fR
to something that the \fBvalidateCommand\fR will not accept it will
be set back to the value of the entry widget.
Using the \fBtextVariable\fR for read-only purposes will never cause problems.
.PP
The \fBvalidateCommand\fR will turn itself off by setting
\&\fBvalidate\fR to \fBnone\fR when an error occurs, for example
when the \fBvalidateCommand\fR or \fBinvalidCommand\fR encounters
an error in its script while evaluating, or
\&\fBvalidateCommand\fR does not return a valid boolean value.
.PP
With the perl/Tk version \fBvalidate\fR option is supposed to be
\&\*(L"suspended\*(R" while executing the \fBvalidateCommand\fR or the \fBinvalidCommand\fR.
This is experimental but in theory either callback can \*(L"correct\*(R" the
value of the widget, and override the proposed change. (\fBvalidateCommand\fR
should still return false to inhibit the change from happening when
it returns.)
.SH "WIDGET METHODS"
.IX Header "WIDGET METHODS"
The \fBEntry\fR method creates a widget object.
This object supports the \fBconfigure\fR and \fBcget\fR methods
described in Tk::options which can be used to enquire and
modify the options described above.
The widget also inherits all the methods provided by the generic
Tk::Widget class.
.PP
Many of the additional methods for entries take one or more indices as
arguments. An index specifies a particular character in the entry's
string, in any of the following ways:
.IP "\fInumber\fR" 4
.IX Item "number"
Specifies the character as a numerical index, where 0 corresponds
to the first character in the string.
.IP "\fBanchor\fR" 4
.IX Item "anchor"
Indicates the anchor point for the selection, which is set with the
\&\fBselectionFrom\fR and \fBselectionAdjust\fR methods.
.IP "\fBend\fR" 4
.IX Item "end"
Indicates the character just after the last one in the entry's string.
This is equivalent to specifying a numerical index equal to the length
of the entry's string.
.IP "\fBinsert\fR" 4
.IX Item "insert"
Indicates the character adjacent to and immediately following the
insertion cursor.
.IP "\fBsel.first\fR" 4
.IX Item "sel.first"
Indicates the first character in the selection. It is an error to
use this form if the selection isn't in the entry window.
.IP "\fBsel.last\fR" 4
.IX Item "sel.last"
Indicates the character just after the last one in the selection.
It is an error to use this form if the selection isn't in the
entry window.
.IP "\fB@\fR\fInumber\fR" 4
.IX Item "@number"
In this form, \fInumber\fR is treated as an x\-coordinate in the
entry's window; the character spanning that x\-coordinate is used.
For example, ``\fB@0\fR'' indicates the left-most character in the
window.
.PP
Abbreviations may be used for any of the forms above, e.g. ``\fBe\fR''
or ``\fBsel.f\fR''. In general, out-of-range indices are automatically
rounded to the nearest legal value.
.PP
The following additional methods are available for entry widgets:
.IP "\fI$entry\fR\->\fBbbox\fR(\fIindex\fR)" 4
.IX Item "$entry->bbox(index)"
Returns a list of four numbers describing the bounding box of the
character given by \fIindex\fR.
The first two elements of the list give the x and y coordinates of
the upper-left corner of the screen area covered by the character
(in pixels relative to the widget) and the last two elements give
the width and height of the character, in pixels.
The bounding box may refer to a region outside the visible area
of the window.
.IP "\fI$entry\fR\->\fBdelete\fR(\fIfirst, \fR?\fIlast\fR?)" 4
.IX Item "$entry->delete(first, ?last?)"
Returns the current value of the configuration option given
by \fIoption\fR.
\&\fIOption\fR may have any of the values accepted by the \fBentry\fR
command.
.IP "\fI$entry\fR\->\fBconfigure\fR(?\fIoption\fR?, ?\fIvalue, option, value, ...\fR?)" 4
.IX Item "$entry->configure(?option?, ?value, option, value, ...?)"
Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \f(CW$entry\fR (see Tk::configure for
information on the format of this list). If \fIoption\fR is specified
with no \fIvalue\fR, then the command returns a list describing the
one named option (this list will be identical 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 command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\&\fIOption\fR may have any of the values accepted by the \fBentry\fR
command.
.IP "\fI$entry\fR\->\fBdelete\fR(\fIfirst, \fR?\fIlast\fR?)" 4
.IX Item "$entry->delete(first, ?last?)"
Delete one or more elements of the entry.
\&\fIFirst\fR is the index of the first character to delete, and
\&\fIlast\fR is the index of the character just after the last
one to delete.
If \fIlast\fR isn't specified it defaults to \fIfirst\fR+1,
i.e. a single character is deleted.
This method returns an empty string.
.IP "\fI$entry\fR\->\fBget\fR" 4
.IX Item "$entry->get"
Returns the entry's string.
.IP "\fI$entry\fR\->\fBicursor\fR(\fIindex\fR)" 4
.IX Item "$entry->icursor(index)"
Arrange for the insertion cursor to be displayed just before the character
given by \fIindex\fR. Returns an empty string.
.IP "\fI$entry\fR\->\fBindex\fR(\fIindex\fR)" 4
.IX Item "$entry->index(index)"
Returns the numerical index corresponding to \fIindex\fR.
.IP "\fI$entry\fR\->\fBinsert\fR(\fIindex, string\fR)" 4
.IX Item "$entry->insert(index, string)"
Insert the characters of \fIstring\fR just before the character
indicated by \fIindex\fR. Returns an empty string.
.IP "\fI$entry\fR\->\fBscan\fR(\fIoption, args\fR)" 4
.IX Item "$entry->scan(option, args)"
.PD 0
.IP "\fI$entry\fR\->\fBscan\fR\fIOption\fR(\fIargs\fR)" 4
.IX Item "$entry->scanOption(args)"
.PD
This method is used to implement scanning on entries. It has
two forms, depending on \fIOption\fR:
.RS 4
.IP "\fI$entry\fR\->\fBscanMark\fR(\fIx\fR)" 8
.IX Item "$entry->scanMark(x)"
Records \fIx\fR and the current view in the entry widget; used in
conjunction with later \fBscanDragto\fR methods. Typically this
method is associated with a mouse button press in the widget. It
returns an empty string.
.IP "\fI$entry\fR\->\fBscanDragto\fR(\fIx\fR)" 8
.IX Item "$entry->scanDragto(x)"
This method computes the difference between its \fIx\fR argument
and the \fIx\fR argument to the last \fBscanMark\fR method for
the widget. It then adjusts the view left or right by 10 times the
difference in x\-coordinates. This method is typically associated
with mouse motion events in the widget, to produce the effect of
dragging the entry at high speed through the widget. The return
value is an empty string.
.RE
.RS 4
.RE
.IP "\fI$entry\fR\->\fBselection\fR(\fIoption, arg\fR)" 4
.IX Item "$entry->selection(option, arg)"
.PD 0
.IP "\fI$entry\fR\->\fBselection\fR\fIOption\fR(\fIarg\fR)" 4
.IX Item "$entry->selectionOption(arg)"
.PD
This method is used to adjust the selection within an entry. It
has several forms, depending on \fIOption\fR:
.RS 4
.IP "\fI$entry\fR\->\fBselectionAdjust\fR(\fIindex\fR)" 8
.IX Item "$entry->selectionAdjust(index)"
Locate 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 other
end of the selection is made the anchor point for future
\&\fBselectionTo\fR methods. If the selection
isn't currently in the entry, then a new selection is created to
include the characters between \fIindex\fR and the most recent
selection anchor point, inclusive.
Returns an empty string.
.IP "\fI$entry\fR\->\fBselectionClear\fR" 8
.IX Item "$entry->selectionClear"
Clear the selection if it is currently in this widget. If the
selection isn't in this widget then the method has no effect.
Returns an empty string.
.IP "\fI$entry\fR\->\fBselectionFrom\fR(\fIindex\fR)" 8
.IX Item "$entry->selectionFrom(index)"
Set the selection anchor point to just before the character
given by \fIindex\fR. Doesn't change the selection.
Returns an empty string.
.IP "\fI$entry\fR\->\fBselectionPresent\fR" 8
.IX Item "$entry->selectionPresent"
Returns 1 if there is are characters selected in the entry,
0 if nothing is selected.
.IP "\fI$entry\fR\->\fBselectionRange\fR(\fIstart, \fR\fIend\fR)" 8
.IX Item "$entry->selectionRange(start, end)"
Sets the selection to include the characters starting with
the one indexed by \fIstart\fR and ending with the one just
before \fIend\fR.
If \fIend\fR refers to the same character as \fIstart\fR or an
earlier one, then the entry's selection is cleared.
.IP "\fI$entry\fR\->\fBselectionTo\fR(\fIindex\fR)" 8
.IX Item "$entry->selectionTo(index)"
If \fIindex\fR is before the anchor point, set the selection
to the characters from \fIindex\fR up to but not including
the anchor point.
If \fIindex\fR is the same as the anchor point, do nothing.
If \fIindex\fR is after the anchor point, set the selection
to the characters from the anchor point up to but not including
\&\fIindex\fR.
The anchor point is determined by the most recent \fBselectionFrom\fR
or \fBselectionAdjust\fR method in this widget.
If the selection isn't in this widget then a new selection is
created using the most recent anchor point specified for the widget.
Returns an empty string.
.RE
.RS 4
.RE
.IP "\fI$entry\fR\->\fBvalidate\fR" 4
.IX Item "$entry->validate"
This command is used to force an evaluation of the \fBvalidateCommand\fR
independent of the conditions specified by the \fBvalidate\fR option. It
returns 0 or 1.
.IP "\fI$entry\fR\->\fBxview\fR(\fIargs\fR)" 4
.IX Item "$entry->xview(args)"
This command is used to query and change the horizontal position of the
text in the widget's window. It can take any of the following
forms:
.RS 4
.IP "\fI$entry\fR\->\fBxview\fR" 8
.IX Item "$entry->xview"
Returns a list containing two elements.
Each element is a real fraction between 0 and 1; together they describe
the horizontal span that is visible in the window.
For example, if the first element is .2 and the second element is .7,
20% of the entry's text is off-screen to the left, the middle 50% is visible
in the window, and 30% of the text is off-screen to the right.
These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
option.
.IP "\fI$entry\fR\->\fBxview\fR(\fIindex\fR)" 8
.IX Item "$entry->xview(index)"
Adjusts the view in the window so that the character given by \fIindex\fR
is displayed at the left edge of the window.
.IP "\fI$entry\fR\->\fBxviewMoveto\fR(\fIfraction\fR)" 8
.IX Item "$entry->xviewMoveto(fraction)"
Adjusts the view in the window so that the character \fIfraction\fR of the
way through the text appears at the left edge of the window.
\&\fIFraction\fR must be a fraction between 0 and 1.
.IP "\fI$entry\fR\->\fBxviewScroll\fR(\fInumber, what\fR)" 8
.IX Item "$entry->xviewScroll(number, what)"
This method 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 abbreviation
of 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 left
become visible; if it is positive then characters farther to the right
become visible.
.RE
.RS 4
.SH "DEFAULT BINDINGS"
.IX Header "DEFAULT BINDINGS"
Tk automatically creates class bindings for entries that give them
the following default behavior.
In the descriptions below, ``word'' refers to a contiguous group
of letters, digits, or ``_'' characters, or any single character
other than these.
.IP "[1]" 4
.IX Item "[1]"
Clicking mouse button 1 positions the insertion cursor
just before the character underneath the mouse cursor, sets the
input focus to this widget, and clears any selection in the widget.
Dragging with mouse button 1 strokes out a selection between
the insertion cursor and the character under the mouse.
.IP "[2]" 4
.IX Item "[2]"
Double-clicking with mouse button 1 selects the word under the mouse
and positions the insertion cursor at the beginning of the word.
Dragging after a double click will stroke out a selection consisting
of whole words.
.IP "[3]" 4
.IX Item "[3]"
Triple-clicking with mouse button 1 selects all of the text in the
entry and positions the insertion cursor before the first character.
.IP "[4]" 4
.IX Item "[4]"
The ends of the selection can be adjusted by dragging with mouse
button 1 while the Shift key is down; this will adjust the end
of the selection that was nearest to the mouse cursor when button
1 was pressed.
If the button is double-clicked before dragging then the selection
will be adjusted in units of whole words.
.IP "[5]" 4
.IX Item "[5]"
Clicking mouse button 1 with the Control key down will position the
insertion cursor in the entry without affecting the selection.
.IP "[6]" 4
.IX Item "[6]"
If any normal printing characters are typed in an entry, they are
inserted at the point of the insertion cursor.
.IP "[7]" 4
.IX Item "[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 selection
is copied into the entry at the position of the mouse cursor.
.IP "[8]" 4
.IX Item "[8]"
If the mouse is dragged out of the entry on the left or right sides
while button 1 is pressed, the entry will automatically scroll to
make more text visible (if there is more text off-screen on the side
where the mouse left the window).
.IP "[9]" 4
.IX Item "[9]"
The Left and Right keys move the insertion cursor one character to the
left or right; they also clear any selection in the entry and set
the selection anchor.
If Left or Right is typed with the Shift key down, then the insertion
cursor moves and the selection is extended to include the new character.
Control-Left and Control-Right move the insertion cursor by words, and
Control-Shift-Left and Control-Shift-Right move the insertion cursor
by 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]" 4
.IX Item "[10]"
The Home key, or Control\-a, will move the insertion cursor to the
beginning of the entry and clear any selection in the entry.
Shift-Home moves the insertion cursor to the beginning of the entry
and also extends the selection to that point.
.IP "[11]" 4
.IX Item "[11]"
The End key, or Control\-e, will move the insertion cursor to the
end of the entry and clear any selection in the entry.
Shift-End moves the cursor to the end and extends the selection
to that point.
.IP "[12]" 4
.IX Item "[12]"
The Select key and Control-Space set the selection anchor to the position
of the insertion cursor. They don't affect the current selection.
Shift-Select and Control-Shift-Space adjust the selection to the
current position of the insertion cursor, selecting from the anchor
to the insertion cursor if there was not any selection previously.
.IP "[13]" 4
.IX Item "[13]"
Control\-/ selects all the text in the entry.
.IP "[14]" 4
.IX Item "[14]"
Control\-\e clears any selection in the entry.
.IP "[15]" 4
.IX Item "[15]"
The F16 key (labelled Copy on many Sun workstations) or Meta-w
copies the selection in the widget to the clipboard, if there is a selection.
.IP "[16]" 4
.IX Item "[16]"
The F20 key (labelled Cut on many Sun workstations) or Control-w
copies the selection in the widget to the clipboard and deletes
the selection.
If there is no selection in the widget then these keys have no effect.
.IP "[17]" 4
.IX Item "[17]"
The F18 key (labelled Paste on many Sun workstations) or Control-y
inserts the contents of the clipboard at the position of the
insertion cursor.
.IP "[18]" 4
.IX Item "[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 of
the insertion cursor.
.IP "[19]" 4
.IX Item "[19]"
The BackSpace key and Control-h delete the selection, if there is one
in the entry.
If there is no selection, it deletes the character to the left of
the insertion cursor.
.IP "[20]" 4
.IX Item "[20]"
Control-d deletes the character to the right of the insertion cursor.
.IP "[21]" 4
.IX Item "[21]"
Meta-d deletes the word to the right of the insertion cursor.
.IP "[22]" 4
.IX Item "[22]"
Control-k deletes all the characters to the right of the insertion
cursor.
.IP "[23]" 4
.IX Item "[23]"
Control-t reverses the order of the two characters to the right of
the insertion cursor.
.Sp
If the entry is disabled using the \fB\-state\fR option, then the entry's
view can still be adjusted and text in the entry can still be selected,
but no insertion cursor will be displayed and no text modifications will
take place.
.Sp
The behavior of entries can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
.RE
.RS 4
.SH "KEYWORDS"
.IX Header "KEYWORDS"
entry, widget