Entry

A single-line themed text field.

Live preview

Try the Theme switcher in the toolbar — this preview restyles live:

Live preview. In the Player's built-in docs viewer (scriptweaver --help), this renders Entry as a live, theme-aware widget you can interact with.

Example

const name = app.Entry({ width: 30 });
name.value = 'Guest';
name.pack.configure({ padx: 16, pady: 8 });

console.log(name.value); // the current text

Options

Option Type Description
textVariable StringVar Two-way bind the contents to a variable.
show string Display each character as this (e.g. '*' for a password).
state string 'normal', 'readonly', or 'disabled'.
justify string 'left', 'center', 'right'.
width number Width in characters.
placeholder string Hint text shown while the field is empty.
font string Text font.
style string A ttk style name (TEntry only).

Methods

Method Description
value Property: get or set the whole contents (a string).
getText() The current contents (same as reading value).
insert(index, text) Insert text at a character index (or 'end').
delete(first, last?) Delete a character range.
clear() Remove all text.
icursor(index) Move the insertion cursor.

Plus the inherited widget methods — see Widget basics.

See also