(define-values (callback-set! callback)
(letrec ([signature/raw
(foreign-lambda* c-string ([nonnull-ihandle handle] [iname/upcase name])
"C_return(iupClassCallbackGetFormat(handle->iclass, name));")]
[set/pointer!
(foreign-lambda c-pointer "IupSetCallback" nonnull-ihandle iname/upcase c-pointer)]
[get/pointer
(foreign-lambda c-pointer "IupGetCallback" nonnull-ihandle iname/upcase)]
[sigils
(irregex "([bifdsvh]*)(?:=([bifdvh]))?")]
[callback-set!
(lambda (handle name proc)
(let* ([sig
(cond
[(irregex-match sigils (or (signature/raw handle name) ""))
=> (lambda (groups)
(string-append
(or (irregex-match-substring groups 2) "i")
(irregex-match-substring groups 1)))]
[else
(error 'callback-set! "callback has bad signature" handle name)])]
it looks like the cb-draw callback has format "iiiiiiC", which doesn't match the sigil regex. I take it that means callbacks with a Canvas* argument are unsupported in chicken-iup?