diff options
author | David Walter Seikel | 2015-03-22 17:35:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2015-03-22 17:35:10 +1000 |
commit | b75e596af61da88aa705491778a5fd6845ab43ba (patch) | |
tree | 1f969b3c4012ae0fb81ab7591ea559403efe855a /src | |
parent | New idea about contact sets. (diff) | |
download | SledjHamr-b75e596af61da88aa705491778a5fd6845ab43ba.zip SledjHamr-b75e596af61da88aa705491778a5fd6845ab43ba.tar.gz SledjHamr-b75e596af61da88aa705491778a5fd6845ab43ba.tar.bz2 SledjHamr-b75e596af61da88aa705491778a5fd6845ab43ba.tar.xz |
Add internal reference for skang modules, so they can find themselves.
Diffstat (limited to 'src')
-rw-r--r-- | src/GuiLua/GuiLua.c | 2 | ||||
-rw-r--r-- | src/GuiLua/test.lua | 2 | ||||
-rw-r--r-- | src/GuiLua/test.skang | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c index 3ef6007..57fa09c 100644 --- a/src/GuiLua/GuiLua.c +++ b/src/GuiLua/GuiLua.c | |||
@@ -165,7 +165,7 @@ static void _on_click(void *data, Evas_Object *obj, void *event_info EINA_UNUSED | |||
165 | { | 165 | { |
166 | lua_State *L = wid->data; | 166 | lua_State *L = wid->data; |
167 | 167 | ||
168 | PD("Doing action %s", wid->action); | 168 | PD("Doing action '%s' for module %s", wid->action, wid->win->module); |
169 | doLuaString(L, wid->action, wid->win->module); | 169 | doLuaString(L, wid->action, wid->win->module); |
170 | } | 170 | } |
171 | } | 171 | } |
diff --git a/src/GuiLua/test.lua b/src/GuiLua/test.lua index ee007ea..7fe2e52 100644 --- a/src/GuiLua/test.lua +++ b/src/GuiLua/test.lua | |||
@@ -2,7 +2,7 @@ | |||
2 | -- By virtue of the fact we are stuffing our result into package.loaded[], just plain running this works as "loading the module". | 2 | -- By virtue of the fact we are stuffing our result into package.loaded[], just plain running this works as "loading the module". |
3 | do -- Only I'm not gonna indent this. | 3 | do -- Only I'm not gonna indent this. |
4 | 4 | ||
5 | local skang = require 'skang' | 5 | skang = require 'skang' |
6 | local _M = skang.moduleBegin('test', nil, 'Copyright 2014 David Seikel', '0.1', '2014-03-27 03:57:00', [[ | 6 | local _M = skang.moduleBegin('test', nil, 'Copyright 2014 David Seikel', '0.1', '2014-03-27 03:57:00', [[ |
7 | local win = skang.window(200, 100, "G'day planet.", 'testWindow') | 7 | local win = skang.window(200, 100, "G'day planet.", 'testWindow') |
8 | skang.thingasm{win, 'quitter', 'Quits the skang window', types = 'widget', widget='"button", "Quit", 10, 10, 100, 30'} | 8 | skang.thingasm{win, 'quitter', 'Quits the skang window', types = 'widget', widget='"button", "Quit", 10, 10, 100, 30'} |
diff --git a/src/GuiLua/test.skang b/src/GuiLua/test.skang index e3b303b..6346a4a 100644 --- a/src/GuiLua/test.skang +++ b/src/GuiLua/test.skang | |||
@@ -1,14 +1,14 @@ | |||
1 | #!/usr/bin/env skang -l test -- Lua allows this shell hack. | 1 | #!/usr/bin/env skang -l test -- Lua allows this shell hack. |
2 | 2 | ||
3 | -- There's an implied local skang = require 'skang' | 3 | -- There's an implied skang = require 'skang' |
4 | -- There's an implied local test = require 'test' | 4 | -- There's an implied test = require 'test' |
5 | 5 | ||
6 | -- This is a bit more verbose than I wanted. lol | 6 | -- This is a bit more verbose than I wanted. lol |
7 | local win = skang.window(200, 100, "G'day planet.", 'testWindow') | 7 | local win = skang.window(200, 100, "G'day planet.", 'testWindow') |
8 | skang.thingasm{win, 'quitter', 'Quits the skang window', types = 'widget', widget='"button", "Quit", 10, 10, 100, 30'} | 8 | skang.thingasm{win, 'quitter', 'Quits the skang window', types = 'widget', widget='"button", "Quit", 10, 10, 100, 30'} |
9 | win.W.quitter.action = 'skang.quit()' -- TODO Should look it up in ThingSpace.commands, and translate 'quit' into the Lua 'skang.quit()'? | 9 | win.W.quitter.action = 'skang.quit()' -- TODO Should look it up in ThingSpace.commands, and translate 'quit' into the Lua 'skang.quit()'? |
10 | 10 | ||
11 | skang.thingasm{win, 'ffuncer', 'Calls ffunc', types = 'widget', widget='"button", "ffunc()", 10, 40, 100, 30', action='test.ffunc(3, 4)'} | 11 | skang.thingasm{win, 'ffuncer', 'Calls ffunc', types = 'widget', widget='"button", "ffunc()", 10, 40, 100, 30', action='ffunc(3, 4)'} |
12 | 12 | ||
13 | test.bar = 'things' | 13 | test.bar = 'things' |
14 | test.ffunc(1, 'two') | 14 | test.ffunc(1, 'two') |