opensubscriber
   Find in this group all groups
 
Unknown more information…

g : guile-gtk-general@gnu.org 29 January 2010 • 9:05AM -0500

(gnome gtk) behavior when opening the display fails
by gregory benison

REPLY TO AUTHOR
 
REPLY TO GROUP




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>))


_______________________________________________
guile-gtk-general mailing list
guile-gtk-general@gnu....
http://lists.gnu.org/mailman/listinfo/guile-gtk-general

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.