MultilineTextInput¶
A scrollable panel that allows for the display and editing of multiple lines of text.





Not supported
Not supported
Usage¶
import toga
textbox = toga.MultilineTextInput()
textbox.value = "Some text.\nIt can be multiple lines of text."
The input can be provided a placeholder value - this is a value that will be displayed to the user as a prompt for appropriate content for the widget. This placeholder will only be displayed if the widget has no content; as soon as a value is provided (either by the user, or programmatically), the placeholder content will be hidden.
Notes¶
- Winforms does not support the use of partially or fully transparent colors for the MultilineTextInput background. If a color with an alpha value is provided (including
TRANSPARENT), the alpha channel will be ignored. ATRANSPARENTbackground will be rendered as white.
Reference¶
toga.MultilineTextInput ¶
MultilineTextInput(
id=None,
style=None,
value=None,
readonly=False,
placeholder=None,
on_change=None,
**kwargs,
)
Bases: Widget
Create a new multi-line text input widget.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The ID for the widget.
TYPE:
|
style
|
A style object. If no style is provided, a default style will be applied to the widget.
TYPE:
|
value
|
The initial content to display in the widget.
TYPE:
|
readonly
|
Can the value of the widget be modified by the user?
TYPE:
|
placeholder
|
The content to display as a placeholder when there is no user content to display.
TYPE:
|
on_change
|
A handler that will be invoked when the value of the widget changes.
TYPE:
|
kwargs
|
Initial style properties.
DEFAULT:
|
placeholder
property
writable
¶
placeholder
The placeholder text for the widget.
A value of None will be interpreted and returned as an empty string.
Any other object will be converted to a string using str().
readonly
property
writable
¶
readonly
Can the value of the widget be modified by the user?
This only controls manual changes by the user (i.e., typing at the
keyboard). Programmatic changes are permitted while the widget has
readonly enabled.
value
property
writable
¶
value
The text to display in the widget.
A value of None will be interpreted and returned as an empty string.
Any other object will be converted to a string using str().
toga.widgets.multilinetextinput.OnChangeHandler ¶
Bases: Protocol
__call__ ¶
__call__(widget, **kwargs)
A handler to invoke when the value is changed.
| PARAMETER | DESCRIPTION |
|---|---|
widget
|
The MultilineTextInput that was changed.
TYPE:
|
kwargs
|
Ensures compatibility with arguments added in future versions.
TYPE:
|