From 89d42715b7c768ab56c45a0a36ba577c6ef26a5a Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 16 May 2014 18:52:28 +1000 Subject: Big TODO++ --- lib/skang.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'lib') diff --git a/lib/skang.lua b/lib/skang.lua index 394c3f8..5c4aec7 100644 --- a/lib/skang.lua +++ b/lib/skang.lua @@ -1058,6 +1058,36 @@ wMum.__call = function (func, ...) end ]] +--[[ TODO - Widgets doing the right thing, in the right place. + +GOAL - GuiLua.c -> _on_click() -> lauL_dostring(L, wid->action) + We want this action to be performed in the environment of the module that created the widget. + Or the one that set the action. + + purkle + local purkle = require 'purkle' + local win = skang.window(.... + win = copy(widgets .... + win.window = Cwindow( .... + lightuserdata *winFang + skang.thingasm{win, 'button1' .... types = 'widget', widget='"button", .... + args = loadstring('"button", .... + setfenv(args, win) + thingy.Cwidget = widget(win.window, args()) + winFang *(win.window) + Widget->data = L + Widget->obj "clicked" callback = _on_click, Widget * + lightuserdata *widget + parent.W[name] = thingy + win.W.button1.action = 'purkle.say(' .... + aIsValid(.... + action(button1, .... + Widget->action = .... + +Store the name of the module that created a window in winFang. +Store the winFang a widget is in in Widget. +]] + window = function(w, h, title, name) name = name or 'myWindow' local win = {} -- cgit v1.1