From: Dmitry Kalyanov Date: Thu, 12 Feb 2009 22:00:33 +0000 (+0300) Subject: Added WITH-GTK-ERROR-MESSAGE-HANDLER X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=38b003330ae742267578b10e9d76f002018a13f0;p=cl-gtk2.git Added WITH-GTK-ERROR-MESSAGE-HANDLER --- 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