aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr/GuiLua/GuiLua.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-04-18 20:23:52 +1000
committerDavid Walter Seikel2014-04-18 20:23:52 +1000
commitb3a9d6b10732f3f65ca0a24aa2a66275e24f8cd7 (patch)
tree50363eeef17eef1785571ee6325828a8dce3c8cc /ClientHamr/GuiLua/GuiLua.c
parentHalf arsed window and button implementation. (diff)
downloadSledjHamr-b3a9d6b10732f3f65ca0a24aa2a66275e24f8cd7.zip
SledjHamr-b3a9d6b10732f3f65ca0a24aa2a66275e24f8cd7.tar.gz
SledjHamr-b3a9d6b10732f3f65ca0a24aa2a66275e24f8cd7.tar.bz2
SledjHamr-b3a9d6b10732f3f65ca0a24aa2a66275e24f8cd7.tar.xz
Trying to add widget actions, but it's broken somehow. Think maybe Keyed is screwing it up?
I need sleep.
Diffstat (limited to 'ClientHamr/GuiLua/GuiLua.c')
-rw-r--r--ClientHamr/GuiLua/GuiLua.c20
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
590static 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
595static 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);
601printf("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
590static int colour(lua_State *L) 608static 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
598static int window(lua_State *L) 615static 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);