From 38b003330ae742267578b10e9d76f002018a13f0 Mon Sep 17 00:00:00 2001 From: Dmitry Kalyanov Date: Fri, 13 Feb 2009 01:00:33 +0300 Subject: [PATCH] Added WITH-GTK-ERROR-MESSAGE-HANDLER --- gtk/gtk.dialog.lisp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gtk/gtk.dialog.lisp b/gtk/gtk.dialog.lisp index 6f92abe..f4ea8db 100644 --- a/gtk/gtk.dialog.lisp +++ b/gtk/gtk.dialog.lisp @@ -90,3 +90,16 @@ (export 'dialog-alternative-button-order) +(defmacro with-gtk-message-error-handler (&body body) + (let ((dialog (gensym)) + (e (gensym))) + `(handler-case + (progn ,@body) + (error (,e) (using* ((,dialog (make-instance 'message-dialog + :message-type :error :buttons :ok + :text (format nil "Error~%~A~%during execution of~%~A" ,e '(progn ,@body))))) + (dialog-run ,dialog) + (object-destroy ,dialog) + nil))))) + +(export 'with-gtk-message-error-handler) \ No newline at end of file -- 1.7.10.4