[rep-gtk: 7/12] illustrate GError handling in example



commit a20434d375d2ce5e3ea6a510d1c015d6fc09f755
Author: Juergen Hoetzel <juergen archlinux org>
Date:   Thu Aug 27 23:37:33 2009 +0200

    illustrate GError handling in example

 examples/gtk-builder.jl |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/examples/gtk-builder.jl b/examples/gtk-builder.jl
index 1d201bd..bd9f829 100644
--- a/examples/gtk-builder.jl
+++ b/examples/gtk-builder.jl
@@ -8,20 +8,19 @@
 	  gui.gtk-2.gtk)
 
   (define builder (gtk-builder-new))
-  (gtk-builder-add-from-file builder "gtk-builder-test.glade")
-  (define window (gtk-builder-get-object builder "window"))
-  (gtk-widget-show-all window)
-
-  (g-signal-connect (gtk-builder-get-object builder "button") "pressed" 
-		    (lambda ()
-		      (message "Button pressed")))
-
-  (gtk-builder-connect-signals builder)
-
-  (setq interrupt-mode 'exit)
-  (recursive-edit))
-
 
+  (condition-case data (progn 
+			 (gtk-builder-add-from-file builder "gtk-builder-test.glade")
+			 (define window (gtk-builder-get-object builder "window"))
+			 (gtk-widget-show-all window)
+			 (g-signal-connect (gtk-builder-get-object builder "button") "pressed" 
+					   (lambda ()
+					     (message "Button pressed")))
+
+			 (gtk-builder-connect-signals builder)
+			 (setq interrupt-mode 'exit)
+			 (recursive-edit))
+    (glib-error (message (cadr data)))))
 
 ;; Local variables:
 ;; major-mode: lisp-mode



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]