TextView

class pyto_ui.TextView(text='')

An editable, multiline and scrollable view containing text.

property autocapitalization_type: AutoCapitalization

The type of autocapitalization to use while editing th text. See Auto Capitalization constants for possible values.

Return type:

Auto Capitalization

property autocorrection: bool

A boolean indicating whether autocorrection is enabled.

Return type:

bool

property did_begin_editing: callable

A function called when the Text View begins editing. Takes the sender Text View as parameter.

Return type:

callable

property did_change: callable

A function called when the Text View’s text changes. Takes the sender Text View as parameter.

Return type:

callable

property did_end_editing: callable

A function called when the Text View ends editing. Takes the sender Text View as parameter.

Return type:

callable

property editable: bool

A boolean indicating whether the text is editable.

Return type:

bool

property font: Font

The font of the text displayed on screen.

Return type:

pyto_ui.Font

property keyboard_appearance: KeyboardAppearance

The appearance of the keyboard used while editing the text. See Keyboard Appearance constants for possible values.

Return type:

Keyboard Appearance

property keyboard_type: KeyboardType

The type of keyboard to use while editing the text. See Keyboard Type constants for possible values.

Return type:

Keyboard Type

load_html(html)

Loads HTML in the Text View.

Parameters:

html – The HTML code to load.

property return_key_type: ReturnKeyType

The type of return key to show on the keyboard used to edit the text. See Return Key Type constants for possible values.

Return type:

Return Key Type

property secure: bool

A boolean indicating whether the keyboard should be configured to enter sensitive data.

Return type:

bool

property selectable: bool

A boolean indicating whether the text is selectable.

Return type:

bool

property selected_range: tuple[int, int]

Returns the selected text range. A tuple of two integers (start, end).

Return type:

tuple[int, int]

property smart_dashes: bool

A boolean indicating whether smart dashes are enabled.

Return type:

bool

property smart_quotes: bool

A boolean indicating whether smart quotes are enabled.

Return type:

bool

property text: str

The text contained in the view.

Return type:

str

property text_alignment: TextAlignment

The alignment of the text displayed on screen. See Text Alignment constants for possible values.

Return type:

Text Alignment

property text_color: Color

The color of the text displayed on screen.

Return type:

pyto_ui.Color