From 3314ac30f127e43d279b4e4384ee98389c4b137a Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 12 May 2014 08:29:43 +1000 Subject: Move poor mans introspection into winFang.c, and use it in purkle. --- src/GuiLua/GuiLua.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/GuiLua/GuiLua.c') diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c index 06bc516..c845ff1 100644 --- a/src/GuiLua/GuiLua.c +++ b/src/GuiLua/GuiLua.c @@ -173,20 +173,16 @@ static void _on_click(void *data, Evas_Object *obj, void *event_info EINA_UNUSED static int widget(lua_State *L) { winFang *win = NULL; + Widget *wid; char *type = "button"; char *title = ":"; int x = -1, y = -1, w = -1, h = -1; pull_lua(L, 1, "*window $type $title %x %y %w %h", &win, &type, &title, &x, &y, &w, &h); - // Poor mans introspection, until I write real introspection into EFL. - // TODO - The alternative is to just lookup the ELM_*_CLASS in a hash table? - if (strcmp(type, "button") == 0) + wid = widgetAdd(win, type, title, x, y, w, h); + if (wid) { - Widget *wid; - - // These two lines are likely the only ones that will be different for the different sorts of widgets. - wid = widgetAdd(win, ELM_OBJ_BUTTON_CLASS, title, x, y, w, h); evas_object_smart_callback_add(wid->obj, "clicked", _on_click, wid); wid->data = L; -- cgit v1.1