summaryrefslogtreecommitdiff
path: root/src/examples/elua
diff options
context:
space:
mode:
authorDaniel Kolesa <quaker66@gmail.com>2014-04-08 14:55:01 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-06-10 15:48:46 +0100
commitb3c36138f9e1084ca5ff523c18387f94a8d2d2b9 (patch)
treecfe7ce323a9504338a012bdc62e328d52aca5af8 /src/examples/elua
parente6278f346f9e58106756199d8ed5ab30daf34f15 (diff)
elua: elm test entry
Diffstat (limited to 'src/examples/elua')
-rw-r--r--src/examples/elua/elm_test.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/examples/elua/elm_test.lua b/src/examples/elua/elm_test.lua
index d44248d..1078804 100644
--- a/src/examples/elua/elm_test.lua
+++ b/src/examples/elua/elm_test.lua
@@ -38,21 +38,26 @@ lbl:text_set("Lua runtime test")
38bx:pack_end(lbl) 38bx:pack_end(lbl)
39lbl:show() 39lbl:show()
40 40
41local counter = nil 41local entry
42local step = 5
43 42
44local btn = elm.Button(win) 43local btn = elm.Button(win)
45btn:text_set("Reset counter") 44btn:text_set("Reset counter")
46bx:pack_end(btn) 45bx:pack_end(btn)
47btn:smart_callback_add("clicked", function() 46btn:smart_callback_add("clicked", function()
48 if not counter then 47 lbl:text_set(entry:entry_get())
49 btn:text_set("Add " .. step)
50 end
51 counter = counter and (counter + step) or 0
52 lbl:text_set(tostring(counter))
53end) 48end)
54btn:show() 49btn:show()
55 50
51entry = elm.Entry(win)
52entry:single_line_set(true)
53entry:scrollable_set(true)
54entry:focus_set(true)
55entry:entry_set("Hello world")
56entry:size_hint_weight_set(1.0, 1.0)
57entry:size_hint_align_set(-1.0, -1.0)
58entry:show()
59bx:pack_end(entry)
60
56win:resize(360, 360) 61win:resize(360, 360)
57win:show() 62win:show()
58 63