chiark
/
gitweb
/
~mdw
/
clg
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4c79512
)
Made signal-connect accept NIL as callback function
author
espen
<espen>
Sat, 4 Dec 2004 00:29:57 +0000
(
00:29
+0000)
committer
espen
<espen>
Sat, 4 Dec 2004 00:29:57 +0000
(
00:29
+0000)
glib/gcallback.lisp
patch
|
blob
|
blame
|
history
diff --git
a/glib/gcallback.lisp
b/glib/gcallback.lisp
index 86177df6747d4d66e2b75e9fc8dff3e1adea59a3..2a8eea6bb4a4912ce0fd5f6a2e43e40897789541 100644
(file)
--- a/
glib/gcallback.lisp
+++ b/
glib/gcallback.lisp
@@
-15,7
+15,7
@@
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: gcallback.lisp,v 1.1
4 2004/11/07 16:04:21
espen Exp $
+;; $Id: gcallback.lisp,v 1.1
5 2004/12/04 00:29:57
espen Exp $
(in-package "GLIB")
(in-package "GLIB")
@@
-160,15
+160,16
@@
(defmethod signal-connect ((gobject gobject) signal function &key after object)
function, or if :OBJECT is any other non NIL value, it is passed as the first
argument instead. If :AFTER is non NIL, the handler will be called after the
default handler of the signal."
function, or if :OBJECT is any other non NIL value, it is passed as the first
argument instead. If :AFTER is non NIL, the handler will be called after the
default handler of the signal."
- (let ((callback-id
- (make-callback-closure
- (cond
- ((or (eq object t) (eq object gobject)) function)
- ((not object)
- #'(lambda (&rest args) (apply function (cdr args))))
- (t
- #'(lambda (&rest args) (apply function object (rest args))))))))
- (signal-connect-closure gobject signal callback-id :after after)))
+ (when function
+ (let ((callback-id
+ (make-callback-closure
+ (cond
+ ((or (eq object t) (eq object gobject)) function)
+ ((not object)
+ #'(lambda (&rest args) (apply function (cdr args))))
+ (t
+ #'(lambda (&rest args) (apply function object (rest args))))))))
+ (signal-connect-closure gobject signal callback-id :after after))))
;;; Message logging
;;; Message logging