Next: , Up: Closures


8.1 create-signal-handler-closure

— Function: create-signal-handler-closure
     (create-signal-handler-closure object fn) => closure
object
An object for which the closure is created
fn
A function that will be called by closure invokation
closure
A foreign pointer to allocated closure

Allocates the closure. The closure is destroyed automatically by GObject.

Example:

     (create-signal-handler-closure obj (lambda (x) (+ x 10)))
     =>
     #.(SB-SYS:INT-SAP #X006D7B20)

Example of usage from GObject binding code:

     (defun connect-signal (object signal handler &key after)
       (g-signal-connect-closure (ensure-object-pointer object)
                                 signal
                                 (create-signal-handler-closure object handler)
                                 after))