open-card-table/test_ui.lua

34 lines
896 B
Lua

require("oct_utils")
require("termbox_defs")
require("ui")
--textbox = oct_tb_sprite_new()
textbox = {}
function oct_init()
-- textbox["x"] = 50
-- textbox["y"] = 20
-- textbox["shape"] = "___________"
-- textbox["fg"] = TB_RED
textbox1 = create_textbox("textbox1", 50, 20, 20, "textbox1: ")
textbox2 = create_textbox("textbox2", 50, 22, 20, "textbox2: ")
textbox3 = create_textbox("textbox3", 50, 24, 20, "textbox3: ")
register_textbox(textbox1)
register_textbox(textbox1)
register_textbox(textbox2)
register_textbox(textbox3)
unregister_textbox(textbox2)
unregister_textbox(textbox2)
return OCT_NOT_NEEDS_NETWORKING, OCT_NEEDS_TERMBOX
end
function oct_loop(key, ch)
textbox_contents = handle_textbox(key, ch)
if (textbox_contents)
then
OCT_LOG_DEBUG("Received string from textbox: " .. table_to_string(textbox_contents))
end
end