Closed mikelevins closed 2 years ago
It works for events that there is no associated data parameter. Like on-click - (mod of tutorial 29)
(link-form-element-to-slot i3 lisp-obj my-count
:set-event #'clog:set-on-click
:transform #'parse-integer)
so the count changes when the input is clicked as opposed to losing focus.
You could wrap it like so:
(link-form-element-to-slot i3 lisp-obj my-count
:set-event (lambda (clog-obj handler)
(set-on-key-down clog-obj
(lambda (obj data)
(funcall handler obj))))
:transform #'parse-integer)
This also allows for you to not fire the event unless say the data is valid etc.
I will try and add some more documentation.
Steps to reproduce:
Expected result: Editing the contents of the element updates the corresponding linked slot.
Found result: If the default :set-event value is used, or if the default (clog:set-on-change) is explicitly passed then the slot is updated as expected. If any other set-on-* is passed for :set-event, then triggering it yields a SIMPLE-PROGRAM-ERROR with message "invalid number of arguments: 2".