From e06d6364c5776183a98a4e69d34d237736388327 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Thu, 4 Apr 2013 10:56:57 +0200 Subject: [PATCH 1/2] gobject: also loop args after #:gsignal. Fixes multiple signals per class. That is, running tic-tac-toe with this patch below now works. diff --git a/gtk/examples/tic-tac-toe.scm b/gtk/examples/tic-tac-toe.scm index 93e323b..8c67896 100644 --- a/gtk/examples/tic-tac-toe.scm +++ b/gtk/examples/tic-tac-toe.scm @@ -34,6 +34,9 @@ exec guile-gnome-2 -s $0 "$@" buttons winning-combinations + ;; adding foo-bar-baz signal breaks tic-tac-toe with + ;; ERROR: Throw to key `gruntime-error' with args `("gsignal-query" "Unknown signal ~A on class ~A" (tic-tac-toe #< >) ())'. + :gsignal '(foo-bar-baz #f) :gsignal '(tic-tac-toe #f)) (define (ttt-clear ttt) @@ -119,6 +122,7 @@ exec guile-gnome-2 -s $0 "$@" (show-all w) (g-timeout-add 100 (lambda () #t)) (connect ttt 'tic-tac-toe (lambda (ttt) (display "Yay!\n"))) + (connect ttt 'foo-bar-baz (lambda (ttt) (display "Nay!\n"))) (connect w 'delete-event (lambda (ttt e) (gtk-main-quit) #f))) (gtk-main) --- glib/gnome/gobject/gobject.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glib/gnome/gobject/gobject.scm b/glib/gnome/gobject/gobject.scm index 3e5f07d..ad6abed 100644 --- a/glib/gnome/gobject/gobject.scm +++ b/glib/gnome/gobject/gobject.scm @@ -131,7 +131,7 @@ (define (install-signals!) ;; We parse a #:gsignal initialization argument to install signals. (let loop ((args initargs)) - (if (not (null? args)) + (when (not (null? args)) (if (eq? (car args) #:gsignal) (let ((signal (cadr args))) (if (not (and (list? signal) (>= (length signal) 2))) @@ -142,8 +142,8 @@ (generic (gtype-class-create-signal class name return-type param-types))) ;; Some magic to define the generic (module-define! (current-module) - (generic-function-name generic) generic))) - (loop (cddr args)))))) + (generic-function-name generic) generic)))) + (loop (cddr args))))) (define (first pred list) (cond ((null? list) #f) -- 1.7.10.4