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/agg-plot/canvas-window.cpp
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 /agg-plot/canvas-window.cpp
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 'agg-plot/canvas-window.cpp')
-rw-r--r--agg-plot/canvas-window.cpp 11
1 files changed, 11 insertions, 0 deletions
diff --git a/agg-plot/canvas-window.cpp b/agg-plot/canvas-window.cpp
index 927a69e7..73cfb81b 100644
--- a/agg-plot/canvas-window.cpp
+++ b/agg-plot/canvas-window.cpp
@@ -69,6 +69,7 @@ static const struct luaL_Reg canvas_window_methods_protected[] = {
{"clear", canvas_window_clear},
{"refresh", canvas_window_refresh},
{"setview", canvas_window_set_box_trans},
+ {"close", canvas_window_close},
{NULL, NULL}
};
@@ -144,9 +145,11 @@ canvas_thread_function (void *_win)
{
win->status = canvas_window::running;
win->run();
+ printf("window id %d terminate.\n", win->id);
win->status = canvas_window::closed;
GSL_SHELL_LOCK();
+ printf("request reference remove window id %d\n", win->id);
gsl_shell_unref_plot (win->id);
GSL_SHELL_UNLOCK();
}
@@ -239,6 +242,14 @@ canvas_window_refresh (lua_State *L)
}
int
+canvas_window_close (lua_State *L)
+{
+ canvas_window *win = canvas_window::check (L, 1);
+ win->close();
+ return 0;
+}
+
+int
canvas_window_index_protected (lua_State *L)
{
canvas_window *win = canvas_window::check(L, lua_upvalueindex(2));
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月16日 04:58:01 +0000

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