nanome.api.ui.text_input module

class TextInput[source]

Bases: nanome._internal.ui.models._TextInput, nanome.api.ui.ui_base.UIBase

Represents a text input, where the user can input text
class HorizAlignOptions

Bases: enum.IntEnum

Horizontal alignment modes for text.
To be used with ui.Label().text_horizontal_align and ui.Button().horizontal_align
Left = 0
Middle = 1
Right = 2
background_color
The color of the background of this text input
Type:Color
input_text
The string that has been entered into this text input
Type:str
max_length
The character limit of the input string
Type:int
number
Whether or not the input represents a number.
Will display the number keyboard if set to true.
Type:bool
padding_bottom
The bottom padding of the input and placeholder text
Type:float
padding_left
The left padding of the input and placeholder text
Type:float
padding_right
The right padding of the input and placeholder text
Type:float
padding_top
The top padding of the input and placeholder text
Type:float
password
Whether or not the input represents a password.
i.e. will display 123 as *** if true.
Type:bool
placeholder_text
The text to display when the input is empty
Type:str
placeholder_text_color
Color of the placeholder text
Type:Color
register_changed_callback(func)[source]
Registers a function to be called whenever the text input is changed.
The function must take a text input as its only parameter.
Parameters:func – The function that will be called when the text input is changed.
register_submitted_callback(func)[source]
Registers a function to be called whenever the user submits a text input.
The function must take a text input as its only parameter.
Parameters:func – The function that will be called when the user submits a text input.
text_color
The color of the input text
Type:Color
text_horizontal_align
The horizontal alignment of the input and placeholder text
Type:HorizAlignOptions
text_size
The font size of the input and placeholder text
Type:float