head	1.24;
access;
symbols
	core-8-5-9:1.22
	core-8-5-8:1.22
	macosx-cocoa-merge:1.24
	macosx-cocoa-premerge:1.24
	macosx-carbon-freeze:1.24
	core-8-5-7:1.22
	core-8-5-6:1.22
	core-8-6-b1:1.24
	core-8-6-a3:1.24
	core-8-5-5:1.22
	core-8-6-a2:1.23
	core-8-5-4:1.22
	core-8-5-3:1.22
	core-8-6-a1:1.22
	core-8-4-19:1.11.2.1
	core-8-5-branch:1.22.0.2
	core-8-5-2:1.22
	core-8-4-18:1.11.2.1
	core-8-5-1:1.22
	core-8-4-17:1.11.2.1
	core-8-5-0:1.22
	core-8-5-b3:1.21
	core-8-5-b2:1.18
	core-8-4-16:1.11.2.1
	core-8-5-b1:1.16
	core-stablilizer-merge:1.16
	core-stabilizer-branch:1.16.0.2
	core-stabilizer-merge:1.22
	core-8-4-15:1.11.2.1
	core-8-5-a6:1.16
	core-8-5-a5:1.15
	core-8-4-14:1.11.2.1
	core-8-5-a4:1.15
	core-8-4-13:1.11.2.1
	core-8-4-12:1.11.2.1
	core-8-4-11:1.11.2.1
	core-8-5-a3:1.15
	core-8-4-10:1.11.2.1
	core-8-4-9-branch:1.11.2.1.0.2
	core-8-5-a2:1.14
	core-8-4-9:1.11.2.1
	core-8-4-8:1.11.2.1
	core-8-4-7:1.11
	core-8-5-a1:1.12
	core-8-4-6:1.11
	core-8-4-5:1.11
	mistachkin-dev-branch:1.11.0.4
	core-8-4-4:1.11
	core-8-4-3:1.11
	core-8-4-branch:1.11.0.2
	core-8-4-2:1.11
	core-8-4-1:1.9
	core-8-3-5:1.4
	core-8-4-0:1.9
	macosx-8-4-merge-2002-08-31-trunk:1.9
	macosx-8-4-premerge-2002-08-31-branch:1.9
	macosx-8-4-premerge-2002-08-31-trunk:1.9
	macosx-8-4-merge-2002-08-30-branch:1.9
	macosx-8-4-merge-2002-08-30-trunk:1.9
	macosx-8-4-merge-2002-08-20-branch:1.9
	macosx-8-4-merge-2002-08-20-trunk:1.9
	core-8-4-b2:1.9
	core-8-4-b1:1.9
	macosx-premerge-6-9-02:1.9
	core-8-4-a4:1.9
	core-8-3-4:1.4
	macosx-8-4-branch:1.9.0.4
	macosx-8-4-branchpoint:1.9
	core-8-4-a3:1.9
	core-8-3-3:1.4
	dgp-privates-into-namespace:1.9.0.2
	tclpro-1-5-0:1.4
	core-8-4-win-speedup:1.8.0.2
	core-8-4-a2:1.8
	tclpro-1-4-1:1.4
	tclpro-1-4-0:1.4
	core-8-3-2:1.4
	ajuba-ajuba2-2-1-base:1.4
	ajuba-ajuba2-2-0:1.4
	core-8-4-a1:1.7
	core-8-3-1-branch:1.4.0.2
	core-8-3-1:1.4
	scriptics-sc-2-0-b5:1.4
	scriptics-sc-2-0-fixed:1.4
	scriptics-sc-2-0-b2:1.4
	scriptics-sc-2-0-b1:1.4
	core-8-3-0:1.3
	core-8-3-b2:1.3
	core-8-3-b1:1.3
	scriptics-sc-1-1:1.2
	scriptics-sc-1-1-b1:1.2
	core-8-2-3:1.2
	scriptics-sc-1-1-branch:1.2.0.16
	scriptics-sc-1-1-base:1.2
	scriptics-sc-1-0:1.2
	scriptics-sc-1-0-branch:1.2.0.14
	scriptics-sc-1-0-base:1.2
	core-8-2-2:1.2
	core-8-2-1:1.2
	scriptics-bc-1-0-b1:1.2
	core-8-2-1-branch:1.2.0.12
	scriptics-tclpro-1-3-0:1.2
	core-8-2-0:1.2
	core-8-2-b3-branch:1.2.0.10
	core-8-2-b3-base:1.2
	scriptics-tclpro-1-3-b4:1.2
	core-8-2-b2:1.2
	scriptics-tclpro-1-3-b3:1.2
	core-8-2-b1:1.2
	scriptics-tclpro-1-3-b2:1.2
	merge-to-mainline-5/21/99:1.2
	scriptics-tclpro-1-3-b2-branch:1.2.0.8
	core-8-1-1:1.2
	scriptics-tclpro-1-3-b1:1.2
	core-8-1-1-base:1.2
	core-8-1-0:1.2
	merge-to-mainline-4-29-99:1.2
	merge-to-mainline-4-23-99:1.2
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.2.0.6
	core-8-0-6-base:1.2
	core-8-0-5:1.2
	core-8-1-b3:1.1.4.1
	core-8-1-b2:1.1.4.1
	dev-8-1-stubs-branch:1.1.4.1.0.2
	dev-stubs-branch:1.2.0.4
	scriptics-tclpro-1-2:1.2
	scriptics-tclpro-1-2-b2:1.2
	core-8-1-merge-2/10/99:1.2
	core-8-0-5-branch:1.2.0.2
	core-8-0-5-base:1.2
	scriptics-tclpro-1-2-b1:1.2
	scriptics-tclpro-1-2-a1:1.2
	core-8-1-b1:1.1.4.1
	core-8-0-4:1.2
	core-8-1-a2:1.1
	core-8-0-2:1.1
	core-8-0-3:1.2;
locks; strict;
comment	@# @;


1.24
date	2008.09.23.13.36.39;	author dkf;	state Exp;
branches;
next	1.23;

1.23
date	2008.06.30.22.57.02;	author dkf;	state Exp;
branches;
next	1.22;

1.22
date	2007.12.13.15.23.43;	author dgp;	state Exp;
branches;
next	1.21;

1.21
date	2007.11.01.10.59.42;	author dkf;	state Exp;
branches;
next	1.20;

1.20
date	2007.10.30.21.29.58;	author dkf;	state Exp;
branches;
next	1.19;

1.19
date	2007.10.29.16.04.13;	author dkf;	state Exp;
branches;
next	1.18;

1.18
date	2007.10.26.20.13.23;	author dgp;	state Exp;
branches;
next	1.17;

1.17
date	2007.10.24.14.32.58;	author dkf;	state Exp;
branches;
next	1.16;

1.16
date	2006.12.13.23.04.32;	author hobbs;	state Exp;
branches
	1.16.2.1;
next	1.15;

1.15
date	2005.04.06.21.11.54;	author dkf;	state Exp;
branches;
next	1.14;

1.14
date	2004.10.28.10.22.51;	author dkf;	state Exp;
branches;
next	1.13;

1.13
date	2004.08.17.22.37.24;	author dkf;	state Exp;
branches;
next	1.12;

1.12
date	2003.12.08.18.47.23;	author hobbs;	state Exp;
branches;
next	1.11;

1.11
date	2003.02.19.18.52.13;	author mdejong;	state Exp;
branches
	1.11.2.1;
next	1.10;

1.10
date	2003.02.09.06.24.07;	author hobbs;	state Exp;
branches;
next	1.9;

1.9
date	2000.12.12.10.35.25;	author dkf;	state Exp;
branches;
next	1.8;

1.8
date	2000.08.25.06.58.32;	author ericm;	state Exp;
branches
	1.8.2.1;
next	1.7;

1.7
date	2000.05.23.00.31.36;	author hobbs;	state Exp;
branches;
next	1.6;

1.6
date	2000.05.17.22.23.25;	author ericm;	state Exp;
branches;
next	1.5;

1.5
date	2000.05.14.20.45.37;	author ericm;	state Exp;
branches;
next	1.4;

1.4
date	2000.03.02.21.53.01;	author hobbs;	state Exp;
branches;
next	1.3;

1.3
date	99.12.14.06.51.44;	author hobbs;	state Exp;
branches;
next	1.2;

1.2
date	98.09.14.18.22.55;	author stanton;	state Exp;
branches;
next	1.1;

1.1
date	98.04.01.09.39.50;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.30.02.16.16;	author stanton;	state Exp;
branches;
next	;

1.8.2.1
date	2002.04.02.20.57.53;	author hobbs;	state Exp;
branches;
next	;

1.11.2.1
date	2004.10.28.10.19.29;	author dkf;	state Exp;
branches;
next	;

1.16.2.1
date	2007.11.01.16.37.14;	author dgp;	state Exp;
branches;
next	;


desc
@@


1.24
log
@Fix [Bug 2118116]
@
text
@'\"
'\" Copyright (c) 1990-1994 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 1998-2000 Scriptics Corporation.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @@(#) $Id: entry.n,v 1.23 2008/06/30 22:57:02 dkf Exp $
'\" 
.so man.macros
.TH entry n 8.3 Tk "Tk Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
entry \- Create and manipulate entry widgets
.SH SYNOPSIS
\fBentry\fR \fIpathName \fR?\fIoptions\fR?
.SO
\-background	\-highlightthickness	\-selectbackground
\-borderwidth	\-insertbackground	\-selectborderwidth
\-cursor	\-insertborderwidth	\-selectforeground
\-exportselection	\-insertofftime	\-takefocus
\-font	\-insertontime	\-textvariable
\-foreground	\-insertwidth	\-xscrollcommand
\-highlightbackground	\-justify
\-highlightcolor	\-relief
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-disabledbackground disabledBackground DisabledBackground
Specifies the background color to use when the entry is disabled.  If
this option is the empty string, the normal background color is used.
.OP \-disabledforeground disabledForeground DisabledForeground
Specifies the foreground color to use when the entry is disabled.  If
this option is the empty string, the normal foreground color is used.
.OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand
Specifies a script to eval when \fBvalidateCommand\fR returns 0.
Setting it to {} 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.
.OP \-readonlybackground readonlyBackground ReadonlyBackground
Specifies the background color to use when the entry is readonly.  If
this option is the empty string, the normal background color is used.
.OP \-show show Show
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
.QW * .
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.
.OP \-state state State
Specifies one of three states for the entry:  \fBnormal\fR,
\fBdisabled\fR, or \fBreadonly\fR.  If the entry is readonly, then the
value may not be changed using widget commands and no insertion cursor
will be displayed, even if the input focus is in the widget; the
contents of the widget may still be selected.  If the entry is
disabled, the value may not be changed, no insertion cursor will be
displayed, the contents will not be selectable, and the entry may
be displayed in a different color, depending on the values of the
\fB\-disabledforeground\fR and \fB\-disabledbackground\fR options.
.OP \-validate validate Validate
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.
.OP "\-validatecommand or \-vcmd" validateCommand ValidateCommand
Specifies a script to eval when you want to validate the input into
the entry widget.  Setting it to {} disables this feature (the default).
This command must return a valid Tcl boolean value.  If it returns 0 (or
the valid Tcl 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.
.OP \-width width Width
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.
.BE
.SH DESCRIPTION
.PP
The \fBentry\fR command creates a new window (given by the
\fIpathName\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
\fIpathName\fR argument.  At the time this command is invoked,
there must not exist a window named \fIpathName\fR, but
\fIpathName\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 widget commands 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 \fBSTRING\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;  commands 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 \fBxScrollCommand\fR option
for details).  They also support scanning, as described below.
.SH VALIDATION
.PP
Validation works by setting the \fBvalidateCommand\fR
option to a script which will be evaluated according to the \fBvalidate\fR
option as follows:
.PP
.IP \fBnone\fR 10
Default.  This means no validation will occur.
.IP \fBfocus\fR 10
\fBvalidateCommand\fR will be called when the entry receives or
loses focus.
.IP \fBfocusin\fR 10
\fBvalidateCommand\fR will be called when the entry receives focus.
.IP \fBfocusout\fR 10
\fBvalidateCommand\fR will be called when the entry loses focus.
.IP \fBkey\fR 10
\fBvalidateCommand\fR will be called when the entry is edited.
.IP \fBall\fR 10
\fBvalidateCommand\fR will be called for all above conditions.
.PP
It is possible to perform percent substitutions on the \fBvalidateCommand\fR
and \fBinvalidCommand\fR,
just as you would in a \fBbind\fR script.  The following substitutions
are recognized:
.PP
.IP \fB%d\fR 5
Type of action: 1 for \fBinsert\fR, 0 for \fBdelete\fR,
or \-1 for focus, forced or textvariable validation.
.IP \fB%i\fR 5
Index of char string to be inserted/deleted, if any, otherwise \-1.
.IP \fB%P\fR 5
The value of the entry if the edit is allowed.  If you are configuring the
entry widget to have a new textvariable, this will be the value of that
textvariable.
.IP \fB%s\fR 5
The current value of entry prior to editing.
.IP \fB%S\fR 5
The text string being inserted/deleted, if any, {} otherwise.
.IP \fB%v\fR 5
The type of validation currently set.
.IP \fB%V\fR 5
The type of validation that triggered the callback
(key, focusin, focusout, forced).
.IP \fB%W\fR 5
The name of the entry widget.
.PP
In general, the \fBtextVariable\fR and \fBvalidateCommand\fR can be
dangerous to mix.  Any problems have been overcome so that using the
\fBvalidateCommand\fR will not interfere with the traditional behavior of
the entry widget.  Using the \fBtextVariable\fR for read-only purposes will
never cause problems.  The danger comes when you try set the
\fBtextVariable\fR to something that the \fBvalidateCommand\fR would not
accept, which causes \fBvalidate\fR to become \fInone\fR (the
\fBinvalidCommand\fR will not be triggered).  The same happens
when an error occurs evaluating the \fBvalidateCommand\fR.
.PP
Primarily, an error will occur when the \fBvalidateCommand\fR or
\fBinvalidCommand\fR encounters an error in its script while evaluating or
\fBvalidateCommand\fR does not return a valid Tcl boolean value.  The
\fBvalidate\fR option will also set itself to \fBnone\fR when you edit the
entry widget from within either the \fBvalidateCommand\fR or the
\fBinvalidCommand\fR.  Such editions will override the one that was being
validated.  If you wish to edit the entry widget (for example set it to {})
during validation and still have the \fBvalidate\fR option set, you should
include the command
.CS
after idle {%W config \-validate %v}
.CE
in the \fBvalidateCommand\fR or \fBinvalidCommand\fR (whichever one you
were editing the entry widget from).  It is also recommended to not set an
associated \fBtextVariable\fR during validation, as that can cause the
entry widget to become out of sync with the \fBtextVariable\fR.
.SH "WIDGET COMMAND"
.PP
The \fBentry\fR command creates a new Tcl command whose
name is \fIpathName\fR.  This command may be used to invoke various
operations on the widget.  It has the following general form:
.CS
\fIpathName subcommand \fR?\fIarg arg ...\fR?
.CE
\fISubcommand\fR and the \fIarg\fRs
determine the exact behavior of the command.
.SS INDICES
.PP
Many of the widget commands 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:
.TP 12
\fInumber\fR
Specifies the character as a numerical index, where 0 corresponds
to the first character in the string.
.TP 12
\fBanchor\fR
Indicates the anchor point for the selection, which is set with the
\fBselect from\fR and \fBselect adjust\fR widget commands.
.TP 12
\fBend\fR
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.
.TP 12
\fBinsert\fR
Indicates the character adjacent to and immediately following the
insertion cursor.
.TP 12
\fBsel.first\fR
Indicates the first character in the selection.  It is an error to
use this form if the selection is not in the entry window.
.TP 12
\fBsel.last\fR
Indicates the character just after the last one in the selection.
It is an error to use this form if the selection is not in the
entry window.
.TP 12
\fB@@\fInumber\fR
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,
.QW \fB@@0\fR
indicates the left-most character in the window.
.LP
Abbreviations may be used for any of the forms above, e.g.
.QW \fBe\fR
or
.QW \fBsel.f\fR .
In general, out-of-range indices are automatically rounded to the
nearest legal value.
.SS SUBCOMMANDS
.PP
The following commands are possible for entry widgets:
.TP
\fIpathName \fBbbox \fIindex\fR
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.
.TP
\fIpathName \fBcget\fR \fIoption\fR
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.
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
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 \fIpathName\fR (see \fBTk_ConfigureInfo\fR 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.
.TP
\fIpathName \fBdelete \fIfirst \fR?\fIlast\fR?
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 is not specified it defaults to \fIfirst\fR+1,
i.e. a single character is deleted.
This command returns an empty string.
.TP
\fIpathName \fBget\fR
Returns the entry's string.
.TP
\fIpathName \fBicursor \fIindex\fR
Arrange for the insertion cursor to be displayed just before the character
given by \fIindex\fR.  Returns an empty string.
.TP
\fIpathName \fBindex\fI index\fR
Returns the numerical index corresponding to \fIindex\fR.
.TP
\fIpathName \fBinsert \fIindex string\fR
Insert the characters of \fIstring\fR just before the character
indicated by \fIindex\fR.  Returns an empty string.
.TP
\fIpathName \fBscan\fR \fIoption args\fR
This command is used to implement scanning on entries.  It has
two forms, depending on \fIoption\fR:
.RS
.TP
\fIpathName \fBscan mark \fIx\fR
Records \fIx\fR and the current view in the entry window;  used in
conjunction with later \fBscan dragto\fR commands.  Typically this
command is associated with a mouse button press in the widget.  It
returns an empty string.
.TP
\fIpathName \fBscan dragto \fIx\fR
This command computes the difference between its \fIx\fR argument
and the \fIx\fR argument to the last \fBscan mark\fR command for
the widget.  It then adjusts the view left or right by 10 times the
difference in x-coordinates.  This command is typically associated
with mouse motion events in the widget, to produce the effect of
dragging the entry at high speed through the window.  The return
value is an empty string.
.RE
.TP
\fIpathName \fBselection \fIoption arg\fR
This command is used to adjust the selection within an entry.  It
has several forms, depending on \fIoption\fR:
.RS
.TP
\fIpathName \fBselection adjust \fIindex\fR
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
\fBselect to\fR commands.  If the selection
is not 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.
.TP
\fIpathName \fBselection clear\fR
Clear the selection if it is currently in this widget.  If the
selection is not in this widget then the command has no effect.
Returns an empty string.
.TP
\fIpathName \fBselection from \fIindex\fR
Set the selection anchor point to just before the character
given by \fIindex\fR.  Does not change the selection.
Returns an empty string.
.TP
\fIpathName \fBselection present\fR
Returns 1 if there is are characters selected in the entry,
0 if nothing is selected.
.TP
\fIpathName \fBselection range \fIstart\fR \fIend\fR
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.
.TP
\fIpathName \fBselection to \fIindex\fR
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 \fBselect from\fR
or \fBselect adjust\fR command in this widget.
If the selection is not in this widget then a new selection is
created using the most recent anchor point specified for the widget.
Returns an empty string.
.RE
.TP
\fIpathName \fBvalidate\fR
This command is used to force an evaluation of the \fBvalidateCommand\fR
independent of the conditions specified by the \fBvalidate\fR option.
This is done by temporarily setting the \fBvalidate\fR option to \fBall\fR.
It returns 0 or 1.
.TP
\fIpathName \fBxview \fIargs\fR
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
.TP
\fIpathName \fBxview\fR
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 .6,
20% of the entry's text is off-screen to the left, the middle 40% is visible
in 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\fR
option.
.TP
\fIpathName \fBxview\fR \fIindex\fR
Adjusts the view in the window so that the character given by \fIindex\fR
is displayed at the left edge of the window.
.TP
\fIpathName \fBxview moveto\fI fraction\fR
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.
.TP
\fIpathName \fBxview scroll \fInumber what\fR
This 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 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
.SH "DEFAULT BINDINGS"
.PP
Tk automatically creates class bindings for entries that give them
the following default behavior. In the descriptions below,
.QW word
refers to a contiguous group of letters, digits, or
.QW _
characters, or any single character other than these.
.IP [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]
Double-clicking with mouse button 1 selects the word under the mouse
and positions the insertion cursor at the end of the word.
Dragging after a double click will stroke out a selection consisting
of whole words.
.IP [3]
Triple-clicking with mouse button 1 selects all of the text in the
entry and positions the insertion cursor at the end of the line.
.IP [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]
Clicking mouse button 1 with the Control key down will position the
insertion cursor in the entry without affecting the selection.
.IP [6]
If any normal printing characters are typed in an entry, they are
inserted 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 selection
is 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 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]
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]
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]
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]
The Select key and Control-Space set the selection anchor to the position
of the insertion cursor.  They do not 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]
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-w
copies 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-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]
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]
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]
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]
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 insertion
cursor.
.IP [23]
Control-t reverses the order of the two characters to the right of
the insertion cursor.
.PP
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
except if the entry is linked to a variable using the \fB\-textvariable\fR
option, in which case any changes to the variable are reflected by the
entry whatever the value of its \fB\-state\fR option.
.PP
The behavior of entries can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
.SH "SEE ALSO"
ttk::entry(n)
.SH KEYWORDS
entry, widget
'\" Local Variables:
'\" mode: nroff
'\" End:
@


1.23
log
@Minor doc updates (removing out of date changebars, improving typedef formatting,
 etc.)
@
text
@a0 1
'\" -*- nroff -*-
d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.22 2007/12/13 15:23:43 dgp Exp $
d539 3
@


1.22
log
@merge stable branch onto HEAD
@
text
@d1 1
d10 1
a10 1
'\" RCS: @@(#) $Id: entry.n,v 1.16.2.1 2007/11/01 16:37:14 dgp Exp $
@


1.21
log
@Make documentation use the name that scripts use as much as possible.
[Bug 1640073]
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.20 2007/10/30 21:29:58 dkf Exp $
@


1.20
log
@More documentation improvements
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.19 2007/10/29 16:04:13 dkf Exp $
a534 1

d536 1
a536 2
ttk_entry(n)

@


1.19
log
@Lots more GOOBE stuff. Now works with 'make html'!
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.18 2007/10/26 20:13:23 dgp Exp $
a83 1

d194 1
a194 1
\fIpathName option \fR?\fIarg arg ...\fR?
d196 1
a196 1
\fIOption\fR and the \fIarg\fRs
d198 1
d243 1
@


1.18
log
@        * doc/*.1:              Revert doc changes that broke
        * doc/*.3:              `make html` so we can get the release
        * doc/*.n:              out the door.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.16 2006/12/13 23:04:32 hobbs Exp $
d48 2
a49 1
the first character in the value of this option, such as ``*''.
d64 1
a64 1
\fB-disabledforeground\fR and \fB-disabledbackground\fR options.
d144 1
a144 1
or -1 for focus, forced or textvariable validation.
d146 1
a146 1
Index of char string to be inserted/deleted, if any, otherwise -1.
d183 1
a183 1
after idle {%W config -validate %v}
d223 1
a223 1
use this form if the selection isn't in the entry window.
d227 1
a227 1
It is an error to use this form if the selection isn't in the
d233 3
a235 2
For example, ``\fB@@0\fR'' indicates the left-most character in the
window.
d237 6
a242 3
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.
d281 1
a281 1
If \fIlast\fR isn't specified it defaults to \fIfirst\fR+1,
d331 1
a331 1
isn't currently in the entry, then a new selection is created to
d338 1
a338 1
selection isn't in this widget then the command has no effect.
d343 1
a343 1
given by \fIindex\fR.  Doesn't change the selection.
d367 1
a367 1
If the selection isn't in this widget then a new selection is
d419 5
a423 4
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.
d484 1
a484 1
of the insertion cursor.  They don't affect the current selection.
@


1.17
log
@Lots of improvements to look and feel of manual pages
@
text
@d48 1
a48 3
the first character in the value of this option, such as
.QW * 
or a bullet character.
d232 2
a233 3
For example,
.QW \fB@@0\fR
indicates the left-most character in the window.
d235 2
a236 5
Abbreviations may be used for any of the forms above, e.g.
.QW \fBe\fR
or
.QW \fBsel.f\fR .
In general, out-of-range indices are automatically
d415 3
a417 5
In the descriptions below,
.QW word
refers to a contiguous group of letters, digits, or
.QW _
characters, or any single character other than these.
@


1.16
log
@	* unix/Makefile.in (install-doc): intentionally skip ttk_dialog.n
	installation (not for public consumption)

	* doc/scrollbar.n, doc/button.n, doc/checkbutton.n:
	* doc/entry.n, doc/frame.n, doc/label.n, doc/labelframe.n:
	* doc/menu.n, doc/menubutton.n, doc/panedwindow.n:
	* doc/radiobutton.n, doc/scrollbar.n, doc/ttk_*: revamp ttk docs
	to use consist nroff format (not 100% consistent with classic
	widget docs).  Add more man page cross-linking "SEE ALSO".
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.15 2005/04/06 21:11:54 dkf Exp $
d48 3
a50 1
the first character in the value of this option, such as ``*''.
d234 3
a236 2
For example, ``\fB@@0\fR'' indicates the left-most character in the
window.
d238 5
a242 2
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
d421 5
a425 3
In the descriptions below, ``word'' refers to a contiguous group
of letters, digits, or ``_'' characters, or any single character
other than these.
@


1.16.2.1
log
@merge updates from HEAD
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.16 2006/12/13 23:04:32 hobbs Exp $
d48 1
a48 2
the first character in the value of this option, such as
.QW * .
d63 1
a63 1
\fB\-disabledforeground\fR and \fB\-disabledbackground\fR options.
d83 1
d143 1
a143 1
or \-1 for focus, forced or textvariable validation.
d145 1
a145 1
Index of char string to be inserted/deleted, if any, otherwise \-1.
d182 1
a182 1
after idle {%W config \-validate %v}
d194 1
a194 1
\fIpathName subcommand \fR?\fIarg arg ...\fR?
d196 1
a196 1
\fISubcommand\fR and the \fIarg\fRs
a197 1
.SS INDICES
d222 1
a222 1
use this form if the selection is not in the entry window.
d226 1
a226 1
It is an error to use this form if the selection is not in the
d232 2
a233 3
For example,
.QW \fB@@0\fR
indicates the left-most character in the window.
d235 3
a237 7
Abbreviations may be used for any of the forms above, e.g.
.QW \fBe\fR
or
.QW \fBsel.f\fR .
In general, out-of-range indices are automatically rounded to the
nearest legal value.
.SS SUBCOMMANDS
d276 1
a276 1
If \fIlast\fR is not specified it defaults to \fIfirst\fR+1,
d326 1
a326 1
is not currently in the entry, then a new selection is created to
d333 1
a333 1
selection is not in this widget then the command has no effect.
d338 1
a338 1
given by \fIindex\fR.  Does not change the selection.
d362 1
a362 1
If the selection is not in this widget then a new selection is
d414 4
a417 5
the following default behavior. In the descriptions below,
.QW word
refers to a contiguous group of letters, digits, or
.QW _
characters, or any single character other than these.
d478 1
a478 1
of the insertion cursor.  They do not affect the current selection.
d528 1
d530 2
a531 1
ttk::entry(n)
@


1.15
log
@Purge old and inaccurate .VS/.VE macros.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.14 2004/10/28 10:22:51 dkf Exp $
d529 3
@


1.14
log
@Assorted minor documentation fixes
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.13 2004/08/17 22:37:24 dkf Exp $
a29 1
.VS 8.4
a35 2
.VE 8.4
.VS 8.3
a40 2
.VE
.VS 8.4
a43 1
.VE
a53 1
.VS 8.4
a63 2
.VE 8.4
.VS 8.3
a76 1
.VE
a116 1
.VS 8.3
a187 1
.VE
a365 1
.VS 8.3
a371 1
.VE
a521 1
.VS
a524 1
.VE
@


1.13
log
@Doc patches [1010083] and [1010607] from Mikhail Kolesnitschenko.
Also some general fixes to menu.n and text.n
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.12 2003/12/08 18:47:23 hobbs Exp $
d126 1
a126 1

a127 1
.SH VALIDATION
d193 1
a193 1
     \fIafter idle {%W config -validate %v}\fR
a199 1

a424 1

@


1.12
log
@clean up usage of 'edition' as a verb
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.11 2003/02/19 18:52:13 mdejong Exp $
d81 2
a82 2
This command must return a valid tcl boolean value.  If it returns 0 (or
the valid tcl boolean equivalent) then it means you reject the new edition
d186 1
a186 1
\fBvalidateCommand\fR does not return a valid tcl boolean value.  The
d337 1
a337 1
(i.e including but not going beyond \fIindex\fR).  The other
@


1.11
log
@	* doc/entry.n:
	* doc/text.n: Update double and triple click
	docs to match implementation changes made on
	2002-02-14.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.10 2003/02/09 06:24:07 hobbs Exp $
d159 1
a159 1
The value of the entry should edition occur.  If you are configuring the
d163 1
a163 1
The current value of entry before edition.
@


1.11.2.1
log
@Backport of documentation fixes
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.11 2003/02/19 18:52:13 mdejong Exp $
d81 2
a82 2
This command must return a valid Tcl boolean value.  If it returns 0 (or
the valid Tcl boolean equivalent) then it means you reject the new edition
d126 2
a128 1
.VS 8.3
d159 1
a159 1
The value of the entry if the edit is allowed.  If you are configuring the
d163 1
a163 1
The current value of entry prior to editing.
d186 1
a186 1
\fBvalidateCommand\fR does not return a valid Tcl boolean value.  The
d194 1
a194 1
after idle {%W config -validate %v}
d201 1
d337 1
a337 1
(i.e. including but not going beyond \fIindex\fR).  The other
d427 1
@


1.10
log
@TP macro misplacement
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.9 2000/12/12 10:35:25 dkf Exp $
d443 1
a443 1
and positions the insertion cursor at the beginning of the word.
d448 1
a448 1
entry and positions the insertion cursor before the first character.
@


1.9
log
@Minor improvement to documentation for entry widgets.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.8 2000/08/25 06:58:32 ericm Exp $
d380 1
a381 1
.VS 8.3
@


1.8
log
@* doc/toplevel.n:
* doc/spinbox.n:
* doc/scrollbar.n:
* doc/scale.n:
* doc/menubutton.n:
* doc/menu.n:
* doc/listbox.n:
* doc/entry.n:
* doc/frame.n:
* doc/message.n:
* doc/checkbutton.n:
* doc/radiobutton.n:
* doc/button.n:
* doc/label.n:
* doc/canvas.n:
* doc/text.n: Fixed Standard Options section to make best use of
new tab settings in man.macros.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.7 2000/05/23 00:31:36 hobbs Exp $
d538 6
a543 1
take place.
@


1.8.2.1
log
@sync with head
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.9 2000/12/12 10:35:25 dkf Exp $
d538 1
a538 6
take place
.VS
except if the entry is linked to a variable using the \fB\-textvariable\fR
option, in which case any changes to the variable are reflected by the
entry whatever the value of its \fB\-state\fR option.
.VE
@


1.7
log
@	* doc/bind.n:
	* doc/canvas.n:
	* doc/entry.n:
	* doc/listbox.n:
	* doc/photo.n: doc fix-ups [Bug: 5396]
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.6 2000/05/17 22:23:25 ericm Exp $
d20 8
a27 9
\-background             \-borderwidth            \-cursor
\-exportselection        \-font                   \-foreground
\-highlightbackground    \-highlightcolor         \-highlightthickness
\-insertbackground       \-insertborderwidth      \-insertofftime
\-insertontime           \-insertwidth            \-justify
\-relief                 \-selectbackground       \-selectborderwidth
\-selectforeground       \-takefocus              \-textvariable
\-xscrollcommand
                                             
@


1.6
log
@* mac/tkMacDefault.h (DEF_ENTRY_READONLY_BG_COLOR,
DEF_ENTRY_READONLY_BG_COLOR):
* win/tkWinDefault.h (DEF_ENTRY_READONLY_BG_COLOR,
DEF_ENTRY_READONLY_BG_COLOR):
* unix/tkUnixDefault.h (DEF_ENTRY_READONLY_BG_COLOR,
DEF_ENTRY_READONLY_BG_COLOR): Added default values for entry
-readonlybackground option.

* generic/tkEntry.c: Added -readonlybackground option, cleaned up
excessive use of graphics contexts.

* tests/entry.test: Added configuration test for
-readonlybackground option.

* doc/entry.n: Added documentation for -readonlybackground option.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.5 2000/05/14 20:45:37 ericm Exp $
d149 1
a149 1
It is posible to perform percent substitutions on the \fBvalidateCommand\fR
@


1.5
log
@* library/entry.tcl: Adjusted Button-1 binding to set focus to the
entry when it is readonly or normal.

* doc/entry.n: Added documentation for readonly state,
-disabledforeground, -disabledbackground.

* tests/entry.test: Added tests for readonly state.

* generic/tkEntry.c: Added support for "readonly" state, and
redefined "disabled" state.  A disabled entry will display its
text in a dimmed color and possibly with a different background,
and will be completely unusable (no selection, no editing).  A
readonly entry will look like a normal entry, but it will not be
editable; selection is still allowed. [RFE: 4239].  To support the
new disabled state properly, "-disabledforeground" and
"-disabledbackground" options were added.
*** THIS IS A BACKWARDS INCOMPATIBLE BEHAVIOR CHANGE ***

* win/tkWinDefault.h:
* mac/tkMacDefault.h:
* unix/tkUnixDefault.h: Added DEF_ENTRY_DISABLED_FG,
DEF_ENTRY_DISABLED_BG_COLOR, DEF_ENTRY_DISABLED_BG_MONO.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.4 2000/03/02 21:53:01 hobbs Exp $
d20 9
a28 8
\-background             \-highlightthickness     \-selectbackground
\-borderwidth            \-insertbackground       \-selectborderwidth
\-cursor                 \-insertborderwidth      \-selectforeground
\-exportselection        \-insertofftime          \-takefocus
\-font                   \-insertontime           \-textvariable
\-foreground             \-insertwidth            \-xscrollcommand
\-highlightbackground    \-justify                
\-highlightcolor         \-relief
d45 5
@


1.4
log
@	* doc/CrtItemType.3: fixed docs for Tk_CreateItemType to reflect
	changes made in 8.3.0 (but old style would still work as well).
	[Bug: 4252]
	* doc/entry.n: improved docs discussing caveats and gotchas when
	mixing textvar with widget validation
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.3 1999/12/14 06:51:44 hobbs Exp $
d20 8
a27 6
\-background	\-highlightbackground	\-insertontime	\-selectforeground
\-borderwidth	\-highlightcolor	\-insertwidth	\-takefocus
\-cursor	\-highlightthickness	\-justify	\-textvariable
\-exportselection	\-insertbackground	\-relief	\-xscrollcommand
\-font	\-insertborderwidth	\-selectbackground
\-foreground	\-insertofftime	\-selectborderwidth
d30 8
d55 1
d57 10
a66 4
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
commands and no insertion cursor will be displayed, even if the input focus is
in the widget.
@


1.3
log
@	* doc/canvas.n: added docs for items added by dash patch (-*dash*,
	-state, -active*, -disabled*, -offset, essentially rewrote the
	man patch for completely updated 8.3 canvas widget.
	* doc/entry.n: added docs for entry widget validation
	* doc/event.n: added docs for -warp
	* doc/text.n: doc'ed new -state value 'hidden'
	* doc/GetDash.3: (new file) man page explaining Tk_GetDash
@
text
@d4 1
d9 1
a9 1
'\" RCS: @@(#) $Id: entry.n,v 1.2 1998/09/14 18:22:55 stanton Exp $
d132 2
a133 2
type of action. 1 == INSERT, 0 == DELETE,
-1 if it's a forced validation or textvariable validation
d135 1
a135 1
index of char string to be added/delete, if any. -1 otherwise
d146 3
a151 1

d155 7
a161 6
the entry widget.  The danger comes when you try set the \fBtextVariable\fR
to something that the \fBvalidateCommand\fR would not accept.  Using the
\fBtextVariable\fR for read-only purposes will never cause problems.
Otherwise, the \fBvalidateCommand\fR will turn itself off by setting
\fBvalidate\fR to \fBnone\fR when an error occurs.

d170 8
a177 3
include the command "\fIafter idle {%W config -validate %v}\fR" in the
\fBvalidateCommand\fR or \fBinvalidCommand\fR (whichever one you were
editing the entry widget from).
d362 3
a364 2
independent of the conditions specified by the \fBvalidate\fR option.  It
returns 0 or 1.
@


1.2
log
@Replaced SCCS strings, fixed binary files
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id$
d11 1
a11 1
.TH entry n 4.1 Tk "Tk Built-In Commands"
d27 7
d49 15
d104 67
d174 1
a174 2
name is \fIpathName\fR.  This
command may be used to invoke various
d349 7
@


1.1
log
@Initial revision
@
text
@d8 1
a8 1
'\" SCCS: @@(#) entry.n 1.41 97/10/31 12:58:44
@


1.1.4.1
log
@Merged 8.0.3 changes into 8.1
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: entry.n,v 1.2 1998/09/14 18:22:55 stanton Exp $
@


