entry pathName [option value...]

The entry command creates a new entry widget named pathName. An entry is a widget that displays a one-line text string that can be edited.

Standard Options
























Widget-Specific Options

-show char (show, Show)

Character to show instead of actual characters typed. Useful for password entries.

-state state (state, State)

State for the entry. State must be normal or disabled.

-width width (width, Width)

Desired width in characters. If zero or less, the width is made large enough to hold current text.

Text Indices

Several entry widget methods support the notion of an index for identifying particular positions within the line of text. Valid index values are as follows:


Character as a numerical index (starting from 0)


Anchor point for the selection


Character just after the last one in the entry’s string


Character just after the insertion cursor


First character in the selection, if in entry


Character just after last one in selection, if in entry


Character at x-coordinate x in entry


pathName bbox index

Return a list of four numbers giving coordinates of upper-left corner (relative to the widget) and width and height of character at index ...

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.