Zpět na projekty
TUIX v0.5Beta

Naposledy aktualizováno: 2026-05-20

Widget Input

Input je jednořádkový textový vstup s placeholderem, pohybem kurzoru, editovatelným aktuálním textem a stavem odeslání.

Vytvoření Input widgetu

uid = objects.create_object(builders.INPUT, 'Main', 0.5, 0.08, 0.45, 0.25)
field = objects.get_object_by_uid(uid)
objects.tuix_input_set_placeholder(field, 'Type here...')
scenes.set_focus('Main', uid)

API funkce

FunkcePopis
objects.tuix_input_set_placeholder(obj, text)Nastaví placeholder text.
objects.tuix_input_is_submitted(obj)Vrátí nenulovou hodnotu, když Enter odešle pole.
objects.tuix_input_get_result(obj)Vrátí odeslaný text jako bytes nebo None.
objects.tuix_input_get_text(obj)Vrátí aktuální text jako bytes.
objects.tuix_input_reset(obj)Vyčistí stav odeslání.
objects.tuix_input_feed_input(obj, snap)Kompatibilní helper; v běžném frame-loop použití není potřeba.

Příklad

while True:
    engine.main_loop()
    if objects.tuix_input_is_submitted(field):
        value = objects.tuix_input_get_result(field)
        break