From 3a877c3abf819f2b36aa7d19bad5035d91d7cb44 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 26 Jan 2014 21:13:56 -0500 Subject: Close example programs when window is closed. * examples/common.scm: Add window close hook. --- examples/common.scm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'examples/common.scm') 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) -- cgit v1.2.3