-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui_main.lua
More file actions
35 lines (29 loc) · 716 Bytes
/
ui_main.lua
File metadata and controls
35 lines (29 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
UI2D = require "ui2d..ui2d"
common = require("common")
local export = {}
local txt1 = ""
function export.draw()
UI2D.Begin( "input", 0, 0 )
txt1, finished_editing = UI2D.TextBox( "", 40, txt1 )
if UI2D.Button( "submit" ) then
common.eval(txt1)
txt1 = ""
end
UI2D.SameLine()
if finished_editing then
end
UI2D.End()
local lst = {}
if common.getBufferLen() > 0 then
lst = common.getBuffer()
end
UI2D.Begin( "output", 0, 130 )
-- UI2D.Label(" ")
-- UI2D.Label("a b\nc d\ne f")
local clicked, idx = UI2D.ListBox( "", 20, 40, lst )
-- if clicked then
-- -- print( "selected item: " .. idx .. " - " .. some_list[ idx ] )
-- end
UI2D.End()
end
return export