diff options
Diffstat (limited to '')
-rw-r--r-- | src/GuiLua/GuiLua.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c index 2e16927..b25c60f 100644 --- a/src/GuiLua/GuiLua.c +++ b/src/GuiLua/GuiLua.c | |||
@@ -175,13 +175,10 @@ static int widget(lua_State *L) | |||
175 | winFang *win = NULL; | 175 | winFang *win = NULL; |
176 | char *type = "button"; | 176 | char *type = "button"; |
177 | char *title = ":"; | 177 | char *title = ":"; |
178 | int x = 1, y = 1, w = WIDTH/3, h = HEIGHT/3, cy; | 178 | int x = 1, y = 1, w = WIDTH/3, h = HEIGHT/3; |
179 | 179 | ||
180 | pull_lua(L, 1, "*window $type $title %x %y %w %h", &win, &type, &title, &x, &y, &w, &h); | 180 | pull_lua(L, 1, "*window $type $title %x %y %w %h", &win, &type, &title, &x, &y, &w, &h); |
181 | 181 | ||
182 | evas_object_geometry_get(win->content, NULL, &cy, NULL, NULL); | ||
183 | y += cy; | ||
184 | |||
185 | // Poor mans introspection, until I write real introspection into EFL. | 182 | // Poor mans introspection, until I write real introspection into EFL. |
186 | // TODO - The alternative is to just lookup the ELM_*_CLASS in a hash table? | 183 | // TODO - The alternative is to just lookup the ELM_*_CLASS in a hash table? |
187 | if (strcmp(type, "button") == 0) | 184 | if (strcmp(type, "button") == 0) |
@@ -192,14 +189,20 @@ static int widget(lua_State *L) | |||
192 | wid = widgetAdd(win, ELM_OBJ_BUTTON_CLASS, win->win, title); | 189 | wid = widgetAdd(win, ELM_OBJ_BUTTON_CLASS, win->win, title); |
193 | wid->data = L; | 190 | wid->data = L; |
194 | eo_do(wid->obj, | 191 | eo_do(wid->obj, |
195 | evas_obj_size_set(w, h), | ||
196 | evas_obj_position_set(x, y), | ||
197 | evas_obj_visibility_set(EINA_TRUE), | 192 | evas_obj_visibility_set(EINA_TRUE), |
198 | eo_key_data_set("Widget", wid, NULL) | 193 | eo_key_data_set("Widget", wid, NULL) |
199 | ); | 194 | ); |
200 | evas_object_smart_callback_add(wid->obj, "clicked", _on_click, wid); | ||
201 | 195 | ||
202 | evas_object_show(win->box); | 196 | if (win->grid) |
197 | elm_grid_pack(win->grid, wid->obj, x, y, w, h); | ||
198 | else | ||
199 | { | ||
200 | eo_do(wid->obj, | ||
201 | evas_obj_size_set(w, h), | ||
202 | evas_obj_position_set(x, y) | ||
203 | ); | ||
204 | } | ||
205 | evas_object_smart_callback_add(wid->obj, "clicked", _on_click, wid); | ||
203 | 206 | ||
204 | lua_pushlightuserdata(L, (void *) wid); | 207 | lua_pushlightuserdata(L, (void *) wid); |
205 | return 1; | 208 | return 1; |