Entry
Entry widgets are simple one-line text widgets. They do not support tags, marks, or embedded windows. The indexing syntax is consequently simpler:
- number
Index into its contents, starting from 0.
-
end End of the text.
-
insert The position immediately after the insertion cursor.
-
sel.first,sel.last Indicates the first and last character of the selection range.
The index argument for all methods in Table A.7 accepts any of the styles described above.
Table A-7. Entry Widget Properties and Methods
|
Properties |
Description |
|---|---|
|
show |
If false, it displays “*”, not the real contents, and is used for obtaining passwords. Note that if the text is selected and pasted elsewhere, the real contents show up. |
|
Methods | |
|
get (index) |
Gets the entire string. |
|
insert (index, string) |
Inserts a string at the index. |
|
index (index) |
Returns the numerical index. |
|
selectionFrom (index) selectionTo (index) selection (from,to) selectionClear |
To set or adjust the selection. |
|
selectionPresent |
True if there’s a selection. |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access