class TextField(Control)

A TextField is a simple single or multi-line text entry area. All text in the field is displayed with the same attributes such as font, color and justification.

Properties

text
Contents of the text field.
selection
A pair (start, end) indicating the starting and ending character positions of the selection. Character positions occur between characters and are numbered from 0.

Note: This property is only valid when the text field is the current target. Setting this property causes the text field to become the target, and the result of reading it when the text field is not the target is undefined.
multiline
Initialize only. A boolean indicating whether multiple lines can be entered. If false, newline characters typed by the user are not entered into the text but are passed on to the next handler.

password
Initialize only. A boolean indicating that the text is to be displayed in an obfuscated manner, as for entering a password.

Note: On some platforms, it may not be possible to combine this with the multiline option.

Action Properties

enter_action
Action to perform when the Return or Enter key is pressed. (Multiline text fields only perform this action when the Enter key on the numeric keypad is used.) The default is 'default_action'.

escape_action
Action to perform when the Escape key is pressed. The default is 'cancel_action'.

Methods

select_all()
Selects all of the text and makes the text field the current target.
cut_cmd()
copy_cmd()
paste_cmd()
clear_cmd()
These implement the standard editing menu commands. The corresponding menu items are enabled automatically whenever the text field has the keyboard focus.

---