Advanced Perl Programming

Advanced Perl ProgrammingSearch this book
Previous: A.2 CanvasAppendix A
Tk Widget Reference
Next: A.4 Listbox
 

A.3 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 a tag.

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.


Previous: A.2 CanvasAdvanced Perl ProgrammingNext: A.4 Listbox
A.2 CanvasBook IndexA.4 Listbox