guile-gtk-general
[Top][All Lists]
Advanced

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

(gnome gtk) behavior when opening the display fails


From: gregory benison
Subject: (gnome gtk) behavior when opening the display fails
Date: Thu, 28 Jan 2010 17:05:38 -0800

Current behavior:

$ DISPLAY=foo guile-gnome-2
guile> (use-modules (gnome gtk))

(<unknown>:2018): Gdk-WARNING **: cannot open display:

$

i.e. if the display can't be opened for some reason, trying to load
(gnome gtk) causes the program simply to exit... which I suppose is
correct behavior, but might it be nice to have a way of catching the
error so that a program could, for example, print out a "hey, I can't
open any displays, what should I do" type of message?

diff --git a/gnome/gw/gdk-spec.scm b/gnome/gw/gdk-spec.scm
index b002829..2a53a0d 100644
--- a/gnome/gw/gdk-spec.scm
+++ b/gnome/gw/gdk-spec.scm
@@ -48,7 +48,7 @@

 (define-method (initializations-cg (self <gdk-wrapset>) err)
   (list (next-method)
-        "gdk_init (NULL, NULL);\n"))
+        "if(!gdk_init_check (NULL, NULL))
scm_throw(scm_from_locale_symbol(\"no-display\"), SCM_EOL);\n"))

 (define-class <gdk-event-type> (<gobject-classed-pointer-type>))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]