aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/GuiLua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/GuiLua/GuiLua.c19
-rw-r--r--src/GuiLua/GuiLua.h4
2 files changed, 15 insertions, 8 deletions
diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c
index 7463abb..3ff8f94 100644
--- a/src/GuiLua/GuiLua.c
+++ b/src/GuiLua/GuiLua.c
@@ -232,7 +232,7 @@ static int colour(lua_State *L)
232static int window(lua_State *L) 232static int window(lua_State *L)
233{ 233{
234 winFang *win = NULL; 234 winFang *win = NULL;
235 Evas_Object *parent = NULL; 235 winFang *parent = NULL;
236 char *name = "GuiLua"; 236 char *name = "GuiLua";
237 char *title = "GuiLua test harness"; 237 char *title = "GuiLua test harness";
238 int w = WIDTH, h = HEIGHT; 238 int w = WIDTH, h = HEIGHT;
@@ -246,7 +246,12 @@ static int window(lua_State *L)
246 if (gl && gl->parent) parent = gl->parent; 246 if (gl && gl->parent) parent = gl->parent;
247 247
248 win = winFangAdd(parent, 25, 25, w, h, title, name); 248 win = winFangAdd(parent, 25, 25, w, h, title, name);
249 eina_clist_add_head(&gl->winFangs, &win->node); 249 // If there's no parent, we become the parent.
250 if (gl && !parent)
251 {
252 gl->parent = win;
253 eina_clist_add_head(&gl->winFangs, &win->node);
254 }
250 lua_pushlightuserdata(L, win); 255 lua_pushlightuserdata(L, win);
251 256
252 return 1; 257 return 1;
@@ -282,10 +287,12 @@ static int closeWindow(lua_State *L)
282 gl = lua_touserdata(L, -1); 287 gl = lua_touserdata(L, -1);
283 lua_pop(L, 1); 288 lua_pop(L, 1);
284 289
285 290 if (gl)
286 EINA_CLIST_FOR_EACH_ENTRY(win, &gl->winFangs, winFang, node)
287 { 291 {
288 winFangDel(win); 292 EINA_CLIST_FOR_EACH_ENTRY(win, &gl->winFangs, winFang, node)
293 {
294 winFangDel(win);
295 }
289 } 296 }
290 297
291 return 0; 298 return 0;
@@ -357,7 +364,7 @@ PD("GuiLua 3");
357 return 1; 364 return 1;
358} 365}
359 366
360GuiLua *GuiLuaDo(int argc, char **argv, Evas_Object *parent) 367GuiLua *GuiLuaDo(int argc, char **argv, winFang *parent)
361{ 368{
362 GuiLua *result; 369 GuiLua *result;
363 lua_State *L; 370 lua_State *L;
diff --git a/src/GuiLua/GuiLua.h b/src/GuiLua/GuiLua.h
index 3548a44..d390000 100644
--- a/src/GuiLua/GuiLua.h
+++ b/src/GuiLua/GuiLua.h
@@ -18,7 +18,7 @@
18typedef struct _GuiLua 18typedef struct _GuiLua
19{ 19{
20 lua_State *L; 20 lua_State *L;
21 Evas_Object *parent; // Our parent window, if it exists. 21 winFang *parent; // Our parent window, if it exists.
22 Eina_Clist winFangs; // The windows we might open. 22 Eina_Clist winFangs; // The windows we might open.
23 23
24 Eina_Clist node; 24 Eina_Clist node;
@@ -26,6 +26,6 @@ typedef struct _GuiLua
26 Evas_Smart_Cb on_del; 26 Evas_Smart_Cb on_del;
27} GuiLua; 27} GuiLua;
28 28
29GuiLua *GuiLuaDo(int argc, char **argv, Evas_Object *parent); 29GuiLua *GuiLuaDo(int argc, char **argv, winFang *parent);
30 30
31#endif 31#endif