aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/examples/demo/ex_gl.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/wx/examples/demo/ex_gl.erl')
-rw-r--r--lib/wx/examples/demo/ex_gl.erl15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/wx/examples/demo/ex_gl.erl b/lib/wx/examples/demo/ex_gl.erl
index 501aed8feb..0e656071b3 100644
--- a/lib/wx/examples/demo/ex_gl.erl
+++ b/lib/wx/examples/demo/ex_gl.erl
@@ -113,7 +113,13 @@ handle_info(stop, State) ->
timer:cancel(State#state.timer),
catch wxGLCanvas:destroy(State#state.canvas),
{stop, normal, State}.
-
+
+handle_call(shutdown, _From, State=#state{parent=Panel}) ->
+ catch wxGLCanvas:destroy(State#state.canvas),
+ timer:cancel(State#state.timer),
+ wxPanel:destroy(Panel),
+ {stop, normal, ok, State};
+
handle_call(Msg, _From, State) ->
io:format("Got Call ~p~n",[Msg]),
{reply,ok,State}.
@@ -125,11 +131,8 @@ handle_cast(Msg, State) ->
code_change(_, _, State) ->
{stop, not_yet_implemented, State}.
-terminate(_Reason, State) ->
- catch wxGLCanvas:destroy(State#state.canvas),
- timer:cancel(State#state.timer),
- timer:sleep(300).
-
+terminate(_Reason, _State) ->
+ ok.
-define(VS, {{-0.5, -0.5, -0.5}, %1