diff options
Diffstat (limited to '')
-rw-r--r-- | ClientHamr/GuiLua/GuiLua.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/ClientHamr/GuiLua/GuiLua.c b/ClientHamr/GuiLua/GuiLua.c index b42df1b..69fef14 100644 --- a/ClientHamr/GuiLua/GuiLua.c +++ b/ClientHamr/GuiLua/GuiLua.c | |||
@@ -587,6 +587,24 @@ static int widget(lua_State *L) | |||
587 | return 0; | 587 | return 0; |
588 | } | 588 | } |
589 | 589 | ||
590 | static void _on_click(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) | ||
591 | { | ||
592 | // TODO, pull the action out of the widget, then somehow magically send it to Lua. | ||
593 | } | ||
594 | |||
595 | static int action(lua_State *L) | ||
596 | { | ||
597 | Evas_Object *obj= lua_touserdata(L, 1); | ||
598 | char *action = "nada"; | ||
599 | |||
600 | pull_lua(L, 2, "$", &action); | ||
601 | printf("Setting action %s\n", action); | ||
602 | // TODO - stuff the action into the widget somewhere. | ||
603 | evas_object_smart_callback_add(obj, "clicked", _on_click, L); | ||
604 | |||
605 | return 0; | ||
606 | } | ||
607 | |||
590 | static int colour(lua_State *L) | 608 | static int colour(lua_State *L) |
591 | { | 609 | { |
592 | // TODO - This is just a stub for now. | 610 | // TODO - This is just a stub for now. |
@@ -594,7 +612,6 @@ static int colour(lua_State *L) | |||
594 | return 0; | 612 | return 0; |
595 | } | 613 | } |
596 | 614 | ||
597 | |||
598 | static int window(lua_State *L) | 615 | static int window(lua_State *L) |
599 | { | 616 | { |
600 | globals *ourGlobals; | 617 | globals *ourGlobals; |
@@ -737,6 +754,7 @@ int luaopen_libGuiLua(lua_State *L) | |||
737 | push_lua(L, "@ ( { = $ $ & $ $acl } )", skang, THINGASM, skang, "Cwindow", "Opens our window.", window, "number,number,string", "GGG", 0); | 754 | push_lua(L, "@ ( { = $ $ & $ $acl } )", skang, THINGASM, skang, "Cwindow", "Opens our window.", window, "number,number,string", "GGG", 0); |
738 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "clear", "The current skin is cleared of all widgets.", clear, 0); | 755 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "clear", "The current skin is cleared of all widgets.", clear, 0); |
739 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "widget", "Create a widget.", widget, 0); | 756 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "widget", "Create a widget.", widget, 0); |
757 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "action", "Add an action to a widget.", action, 0); | ||
740 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "Colour", "Change widget colours.", colour, 0); | 758 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "Colour", "Change widget colours.", colour, 0); |
741 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "loopWindow", "Run our windows main loop.", loopWindow, 0); | 759 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "loopWindow", "Run our windows main loop.", loopWindow, 0); |
742 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "quit", "Quit, exit, remove thyself.", quit, 0); | 760 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "quit", "Quit, exit, remove thyself.", quit, 0); |