From b75e596af61da88aa705491778a5fd6845ab43ba Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 22 Mar 2015 17:35:10 +1000 Subject: Add internal reference for skang modules, so they can find themselves. --- src/GuiLua/GuiLua.c | 2 +- src/GuiLua/test.lua | 2 +- src/GuiLua/test.skang | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/GuiLua') 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 { lua_State *L = wid->data; - PD("Doing action %s", wid->action); + PD("Doing action '%s' for module %s", wid->action, wid->win->module); doLuaString(L, wid->action, wid->win->module); } } 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 @@ -- By virtue of the fact we are stuffing our result into package.loaded[], just plain running this works as "loading the module". do -- Only I'm not gonna indent this. -local skang = require 'skang' +skang = require 'skang' local _M = skang.moduleBegin('test', nil, 'Copyright 2014 David Seikel', '0.1', '2014-03-27 03:57:00', [[ local win = skang.window(200, 100, "G'day planet.", 'testWindow') 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 @@ #!/usr/bin/env skang -l test -- Lua allows this shell hack. --- There's an implied local skang = require 'skang' --- There's an implied local test = require 'test' +-- There's an implied skang = require 'skang' +-- There's an implied test = require 'test' -- This is a bit more verbose than I wanted. lol local win = skang.window(200, 100, "G'day planet.", 'testWindow') skang.thingasm{win, 'quitter', 'Quits the skang window', types = 'widget', widget='"button", "Quit", 10, 10, 100, 30'} win.W.quitter.action = 'skang.quit()' -- TODO Should look it up in ThingSpace.commands, and translate 'quit' into the Lua 'skang.quit()'? -skang.thingasm{win, 'ffuncer', 'Calls ffunc', types = 'widget', widget='"button", "ffunc()", 10, 40, 100, 30', action='test.ffunc(3, 4)'} +skang.thingasm{win, 'ffuncer', 'Calls ffunc', types = 'widget', widget='"button", "ffunc()", 10, 40, 100, 30', action='ffunc(3, 4)'} test.bar = 'things' test.ffunc(1, 'two') -- cgit v1.1