traitsui.editors.text_editor module

Defines the text editor factory for all traits toolkit backends.

class traitsui.editors.text_editor.TextEditor(*args, **traits)[source]

Bases: traitsui.editor_factory.EditorFactory

Editor factory for text editors.

auto_set = Bool(True)

Is user input set on every keystroke?

cancel_button = Bool(False)

Whether or not to display a clear button for the text. This only works in the qt>=5.2 backend for simple/text styles of the editor. Note this trait is currently provisional and may be replaced in the future by a more general feature.

enter_set = Bool(False)

Is user input set when the Enter key is pressed?

evaluate = evaluate_trait

Function to evaluate textual user input

evaluate_name = Str()

The object trait containing the function used to evaluate user input

mapping = mapping_trait

Dictionary that maps user input to other values

multi_line = Bool(True)

Is multi-line text allowed?

password = Bool(False)

Is user input unreadable? (e.g., for a password)

placeholder = Str()

Grayed-out placeholder text to be displayed when the editor is empty.

read_only = Bool(False)

Is editor readonly (will use custom / default editor appearance with readonly flag set to true) in contrast with readonly style for item when completely another editor is used

readonly_allow_selection = Bool(True)

In a read-only text editor, allow selection and copying of the text.

view = AView

The optional view to display when a read-only text editor is clicked:


alias of traitsui.editors.text_editor.TextEditor

traitsui.editors.text_editor.evaluate_trait = Any(_Identity())

Function used to evaluate textual user input

traitsui.editors.text_editor.mapping_trait = Dict(Str, Any)

Mapping from user input text to other value