summaryrefslogtreecommitdiff
path: root/src/examples/elua
diff options
context:
space:
mode:
authorDaniel Kolesa <quaker66@gmail.com>2014-04-03 16:01:01 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-06-10 15:48:46 +0100
commit832f652a5abbb6c8a6bb4fa38adb84edfd7b5e22 (patch)
tree27726762001c001ab3e5d45e39b0ebdb138d178d /src/examples/elua
parent3e81b73aa8998796968bf732b37a675a6d30e70e (diff)
Elua: initial commit
Elua is a LuaJIT based runtime for the EFL meant to provide facilities for rapid application development. The name is temporary. The EFL bindings will be generated with Eolian. @feature
Diffstat (limited to 'src/examples/elua')
-rw-r--r--src/examples/elua/Makefile.am17
-rw-r--r--src/examples/elua/elm_test.lua38
2 files changed, 55 insertions, 0 deletions
diff --git a/src/examples/elua/Makefile.am b/src/examples/elua/Makefile.am
new file mode 100644
index 0000000..63d102d
--- /dev/null
+++ b/src/examples/elua/Makefile.am
@@ -0,0 +1,17 @@
1if HAVE_ELUA
2
3MAINTAINERCLEANFILES = Makefile.in
4
5DATA_FILES = Makefile.examples
6EXTRA_DIST = $(DATA_FILES)
7
8install-examples:
9 mkdir -p $(datadir)/elua/examples
10 $(install_sh_DATA) -c $(DATA_FILES) $(datadir)/elua/examples
11
12uninstall-local:
13 for f in $(DATA_FILES); do \
14 rm -f $(datadir)/elua/examples/$$f ; \
15 done
16
17endif
diff --git a/src/examples/elua/elm_test.lua b/src/examples/elua/elm_test.lua
new file mode 100644
index 0000000..77076d4
--- /dev/null
+++ b/src/examples/elua/elm_test.lua
@@ -0,0 +1,38 @@
1local win = elm.Window("test", "Hello World")
2
3win:smart_callback_add("delete,request", function()
4 elm.exit()
5end)
6
7local bg = elm.Background(win)
8bg:size_hint_weight_set(1.0, 1.0)
9win:resize_object_add(bg)
10bg:show()
11
12local bx = elm.Box(win)
13bx:size_hint_weight_set(1.0, 1.0)
14win:resize_object_add(bx)
15bx:show()
16
17local lbl = elm.Label(win)
18lbl:text_set("Lua runtime test")
19bx:pack_end(lbl)
20lbl:show()
21
22local counter = nil
23local step = 5
24
25local btn = elm.Button(win)
26btn:text_set("Reset counter")
27bx:pack_end(btn)
28btn:smart_callback_add("clicked", function()
29 if not counter then
30 btn:text_set("Add " .. step)
31 end
32 counter = counter and (counter + step) or 0
33 lbl:text_set(tostring(counter))
34end)
35btn:show()
36
37win:resize(360, 360)
38win:show() \ No newline at end of file