Multi-line text input¶
The Multi-line text input is similar to the text input but designed for larger inputs, similar to the textarea field of HTML.
Usage¶
import toga
textbox = toga.MultilineTextInput(id='view1')
Reference¶
-
class
toga.interface.widgets.multilinetextinput.MultilineTextInput(id=None, style=None, initial=None, readonly=False, placeholder=None)¶ A multi-line text input widget
Instantiate a new instance of the multi-line text input widget
Parameters: - id (
str) – An identifier for this widget. - style (
colosseum.CSSNode) – an optional style object. If no style is provided then a new one will be created for the widget. - initial (
str) – The initial value - readonly (
bool) – Whether a user can write into the text input, defaults to False - placeholder (
str) – The placeholder text
-
add(child)¶ Add a widget as a child of this one.
Raises an
ValueErrorif this widget is a leaf, and cannot have children.Parameters: child ( toga.Widget) – The child to add to the widget
-
app¶ The App to which this widget belongs.
Return type: toga.App
-
children¶ The children of this node.
This always returns a list, even if the node is a leaf and cannot have children.
Return type: listReturns: A list of the children for this widget
-
clear()¶ Clear the value
-
hide()¶ Hide the widget from the super view.
-
id¶ The node identifier. This id can be used to target CSS directives
Return type: str
-
parent¶ The parent of this node.
Return type: toga.Widget
-
placeholder¶ The placeholder text
Return type: str
-
readonly¶ Whether a user can write into the text input
Return type: bool
-
set_font(font)¶ Set a font on this widget.
Parameters: font ( toga.Font) – The new font
-
show()¶ Show the widget on the super view.
-
style¶ The style object for this widget.
Returns: The style for this widget Return type: colosseum.CSSNode
-
value¶ The value of the multiline text input field
Return type: str
-
window¶ The Window to which this widget belongs.
Return type: toga.Window
- id (

