aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/GuiLua/GuiLua.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/GuiLua/GuiLua.c10
1 files changed, 3 insertions, 7 deletions
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
173static int widget(lua_State *L) 173static int widget(lua_State *L)
174{ 174{
175 winFang *win = NULL; 175 winFang *win = NULL;
176 Widget *wid;
176 char *type = "button"; 177 char *type = "button";
177 char *title = ":"; 178 char *title = ":";
178 int x = -1, y = -1, w = -1, h = -1; 179 int x = -1, y = -1, w = -1, h = -1;
179 180
180 pull_lua(L, 1, "*window $type $title %x %y %w %h", &win, &type, &title, &x, &y, &w, &h); 181 pull_lua(L, 1, "*window $type $title %x %y %w %h", &win, &type, &title, &x, &y, &w, &h);
181 182
182 // Poor mans introspection, until I write real introspection into EFL. 183 wid = widgetAdd(win, type, title, x, y, w, h);
183 // TODO - The alternative is to just lookup the ELM_*_CLASS in a hash table? 184 if (wid)
184 if (strcmp(type, "button") == 0)
185 { 185 {
186 Widget *wid;
187
188 // These two lines are likely the only ones that will be different for the different sorts of widgets.
189 wid = widgetAdd(win, ELM_OBJ_BUTTON_CLASS, title, x, y, w, h);
190 evas_object_smart_callback_add(wid->obj, "clicked", _on_click, wid); 186 evas_object_smart_callback_add(wid->obj, "clicked", _on_click, wid);
191 wid->data = L; 187 wid->data = L;
192 188