added win32 platform specific functions to close windows - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/window-refs.c
diff options
context:
space:
mode:
authorfrancesco-ST <francesco.abbate@st.com>2010年08月04日 15:26:20 +0200
committerfrancesco-ST <francesco.abbate@st.com>2010年08月04日 15:26:20 +0200
commit544643a77a901bc27fc17b7756764c1cb8ccc2a8 (patch)
tree246e1d2896b984ea9dab3b233fcf801935edc71e /window-refs.c
parentf145fa7be5615ac2ffc15f5859e1c9290ba5b9e3 (diff)
downloadgsl-shell-544643a77a901bc27fc17b7756764c1cb8ccc2a8.tar.gz
added win32 platform specific functions to close windows
Now all the windows are closed to close the main program to ensure proper object finalisations.
Diffstat (limited to 'window-refs.c')
-rw-r--r--window-refs.c 19
1 files changed, 18 insertions, 1 deletions
diff --git a/window-refs.c b/window-refs.c
index 4cbfa1d3..0d1c40cb 100644
--- a/window-refs.c
+++ b/window-refs.c
@@ -3,6 +3,7 @@
#include <lauxlib.h>
#include "window-refs.h"
+#include "canvas-window.h"
static char const * const window_ref_table_name = "GSL.windows";
@@ -30,10 +31,26 @@ window_ref_add(lua_State *L, int index)
}
void
-window_ref_remove(lua_State *L, int id)
+window_ref_remove (lua_State *L, int id)
{
lua_getfield (L, LUA_REGISTRYINDEX, window_ref_table_name);
lua_pushnil (L);
lua_rawseti (L, -2, id);
lua_pop (L, 1);
}
+
+void
+window_ref_close_all (lua_State *L)
+{
+ lua_getfield (L, LUA_REGISTRYINDEX, window_ref_table_name);
+
+ lua_pushnil (L); /* first key */
+ while (lua_next(L, -2) != 0)
+ {
+ lua_pushcfunction (L, canvas_window_close);
+ lua_insert (L, -2);
+ lua_call (L, 1, 0);
+ }
+
+ lua_pop (L, 1);
+}
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月27日 21:25:47 +0000

AltStyle によって変換されたページ (->オリジナル) /