diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-01-26 21:13:56 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-01-26 21:13:56 -0500 |
commit | 3a877c3abf819f2b36aa7d19bad5035d91d7cb44 (patch) | |
tree | cea8568c10a70bf7400a1f5cbb6f1b2792f80f68 /examples | |
parent | 302f3dbe2c9f0270e80224e6483544b388c14590 (diff) |
Close example programs when window is closed.
* examples/common.scm: Add window close hook.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/common.scm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/common.scm b/examples/common.scm index 15bc53b..0c380f2 100644 --- a/examples/common.scm +++ b/examples/common.scm @@ -1,4 +1,6 @@ (use-modules (2d keyboard) + (2d game) + (2d window) (2d repl server)) (spawn-server) @@ -6,3 +8,5 @@ (add-hook! key-press-hook (lambda (key unicode) (when (eq? key 'escape) (quit-game)))) + +(add-hook! window-close-hook quit-game) |