aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/GuiLua/GuiLua.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-06 18:58:24 +1000
committerDavid Walter Seikel2014-05-06 18:58:24 +1000
commitd35bf6bc49a93bbb02abfbfb61f5d695ab782f94 (patch)
treeb01e0a4196ebbe487ff35eaea49ed4a9a746fc0f /src/GuiLua/GuiLua.c
parentGuiLua's self delete when their first window gets deleted. (diff)
downloadSledjHamr-d35bf6bc49a93bbb02abfbfb61f5d695ab782f94.zip
SledjHamr-d35bf6bc49a93bbb02abfbfb61f5d695ab782f94.tar.gz
SledjHamr-d35bf6bc49a93bbb02abfbfb61f5d695ab782f94.tar.bz2
SledjHamr-d35bf6bc49a93bbb02abfbfb61f5d695ab782f94.tar.xz
CloseWindow() now just winFangDel()'s the passed in winFang.
Diffstat (limited to 'src/GuiLua/GuiLua.c')
-rw-r--r--src/GuiLua/GuiLua.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c
index 643a9d5..fe398c8 100644
--- a/src/GuiLua/GuiLua.c
+++ b/src/GuiLua/GuiLua.c
@@ -299,14 +299,10 @@ static int quit(lua_State *L)
299 299
300static int closeWindow(lua_State *L) 300static int closeWindow(lua_State *L)
301{ 301{
302 GuiLua *gl; 302 winFang *win = NULL;
303
304 lua_getfield(L, LUA_REGISTRYINDEX, glName);
305 gl = lua_touserdata(L, -1);
306 lua_pop(L, 1);
307 303
308 if (gl) 304 pull_lua(L, 1, "*window", &win);
309 winFangDel(gl->parent); 305 if (win) winFangDel(win);
310 306
311 return 0; 307 return 0;
312} 308}
@@ -368,7 +364,7 @@ PD("GuiLua 3");
368 push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "Colour", "Change widget colours.", colour, 0); 364 push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "Colour", "Change widget colours.", colour, 0);
369 push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "loopWindow", "Run our windows main loop.", loopWindow, 0); 365 push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "loopWindow", "Run our windows main loop.", loopWindow, 0);
370 push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "quit", "Quit, exit, remove thyself.", quit, 0); 366 push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "quit", "Quit, exit, remove thyself.", quit, 0);
371 push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "closeWindow", "Closes our window.", closeWindow, 0); 367 push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "closeWindow", "Closes a window.", closeWindow, 0); // TODO - closeWindow, "userdata");
372 368
373 // A test of the array building stuff. 369 // A test of the array building stuff.
374 push_lua(L, "@ ( { = $ $ % $widget !required } )", skang, THINGASM, skang, "wibble", "It's wibbly!", 1, "'edit', 'The wibblinator:', 1, 1, 10, 50", 1, 0); 370 push_lua(L, "@ ( { = $ $ % $widget !required } )", skang, THINGASM, skang, "wibble", "It's wibbly!", 1, "'edit', 'The wibblinator:', 1, 1, 10, 50", 1, 0);