ui.TextBox

ui.TextBox

class

Single line the player types into

Fields

NameTypeDescription
text string Current UTF-8 text
hint string Greyed text shown while the field is empty
on_changed function? Called with the text after every edit the player makes
on_commit function? Called with the text when the player presses Enter

Functions

ui.TextBox:focus()

Give the field keyboard focus

Inherited from ui.Widget (7)
  • visible Hidden widgets keep their place in the tree and take no input
  • fill Share of the free space this widget takes along an HBox or VBox; zero keeps it at the size of its content
  • width Fixed width in slate units; zero lets the content decide
  • height Fixed height in slate units; zero lets the content decide
  • padding Space between the edge of the widget and its content: one number for every side, { horizontal, vertical } or { left, top, right, bottom }; reads as the four sides
  • halign Where the widget sits across the width its parent gives it: "fill", "left", "center" or "right"; unset is "fill", or "left" when the width is fixed
  • valign Where the widget sits across the height its parent gives it: "fill", "top", "center" or "bottom"; unset is "fill", or "top" when the height is fixed
Inherited from Object (5)