From 9ce86c55c6eecb522024529bc42ee81cf3ad3672 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 20 Apr 2014 05:13:38 +1000 Subject: Let actions and other stuff set in the thingasm() call work through their isValid(). --- ClientHamr/GuiLua/skang.lua | 6 +++--- ClientHamr/GuiLua/test.skang | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'ClientHamr') diff --git a/ClientHamr/GuiLua/skang.lua b/ClientHamr/GuiLua/skang.lua index fdd61de..74bebd4 100644 --- a/ClientHamr/GuiLua/skang.lua +++ b/ClientHamr/GuiLua/skang.lua @@ -881,9 +881,9 @@ thingasm = function (names, ...) local args, err = loadstring('return ' .. thingy.widget) if args then setfenv(args, parent) - local result = widget(args()) -print('NO IDEA WHY this does isValid() three times on the action, and the first one being a string.') - parent.W[name] = {Cwidget = result} + thingy.Cwidget = widget(args()) +print('\nNO IDEA WHY this does isValid() three times on the action, and the first one being a string.') + parent.W[name] = thingy else print("ERROR - " .. err) end diff --git a/ClientHamr/GuiLua/test.skang b/ClientHamr/GuiLua/test.skang index 432ab71..518207b 100644 --- a/ClientHamr/GuiLua/test.skang +++ b/ClientHamr/GuiLua/test.skang @@ -11,7 +11,6 @@ skang.thingasm{win, 'quitter', 'Quits the skang window', types = 'widget', widge win.W.quitter.action = 'skang.quit()' -- TODO Should look it up in ThingSpace.commands, and translat '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)'} -win.W.ffuncer.action = 'test.ffunc(3, 4)' --other.foo = 'stuff' this.bar = 'things' -- cgit v1.1