The Entry Widget
Create an entry widget with the Entry
method. The
value that the user has typed into
the widget is stored in the variable pointed to by the
-textvariable
option.
$parent->Entry (options)
The standard configuration options that apply to Entry
are:
-background
,
-bg
,
-borderwidth
,
-bd
,
-cursor
,
-exportselection
,
-font
,
-foreground
,
-fg
,
-highlightbackground
,
-highlightcolor
,
-highlightthickness
,
-insertbackground
,
-insertborderwidth
,
-insertofftime
,
-insertontime
,
-insertwidth
,
-justify
,
-relief
,
-selectbackground
,
-selectborderwidth
,
-selectforeground
,
-state
,
-takefocus
,
and
-xscrollcommand
.
Other options are:
-
-show =>
x
Defines a character to be displayed in place of actual typed text (for use with passwords).
-
-textvariable =>
\$variable
Points to the variable containing text to be displayed in the entry widget. Button text will change as
$variable
does.
Text Indexes
In an Entry widget, several indexes are defined to identify positions in the entry text, for use by the methods used for retrieving or manipulating entry text. These indexes are:
-
n
An integer representing a character position, with 0 as the first character in the string.
-
insert
The character directly after the insert cursor.
-
sel.first
The first character in the selection block.
-
sel.last
The character after the last character in the selection block.
-
anchor
The anchored position.
-
end
The position just after the last character in the entry string.
-
@
x
The character containing the specified
x
coordinate. ...
Get Perl in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.