Added forgotten file
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sat, 4 Jul 2009 06:25:08 +0000 (10:25 +0400)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sat, 4 Jul 2009 06:25:08 +0000 (10:25 +0400)
gtk/sbcl.lisp [new file with mode: 0644]

diff --git a/gtk/sbcl.lisp b/gtk/sbcl.lisp
new file mode 100644 (file)
index 0000000..59830eb
--- /dev/null
@@ -0,0 +1,14 @@
+(in-package :gtk)
+
+#+thread-support
+(progn
+  (defun stop-main-thread-on-save ()
+    (when (and *main-thread* (bt:thread-alive-p *main-thread*))
+      (within-main-loop-and-wait (gtk-main-quit))
+      (bt:destroy-thread *main-thread*)
+      (setf *main-thread* nil)))
+  (defun cl-gtk2-sbcl-init ()
+    (gtk-init))
+  (pushnew 'cl-gtk2-sbcl-init sb-ext:*init-hooks*)
+  (pushnew 'stop-main-thread-on-save sb-ext:*save-hooks*))
+