Package: gobject
Function gobject:signal-connect
Lambda Listgobject:signal-connect (instance signal handler &key after) ArgumentsReturn ValueThe unsigned long integer with the handler ID. Details
Connects a Lisp callback function to a signal for a particular object.
The handler will be called before the default handler of the signal. If the after keyword argument is true, the handler will be called after
the default handler of the signal. Lisp implmentationExamples(g:signal-connect button "toggled" (lambda (widget) (if (gtk:toggle-button-active widget) (progn ;; If control reaches here, the toggle button is down ) (progn ;; If control reaches here, the toggle button is up ))))If it is necessary to have a separate function which needs user data, the following implementation is possible: (defun separate-event-handler (widget arg1 arg2 arg3) [ here is the code of the event handler ] )If no extra data is needed, but the callback function should be separated out than it is also possible to implement something like: (g:signal-connect window "destroy" #'separate-event-handler) | See also |
2025-1-4