lispnik / iup

Common Lisp CFFI bindings to the IUP Portable User Interface library (pre-ALPHA)
Other
139 stars 7 forks source link

IUP:CALLBACK not creating right key for *REGISTERED-CALLBACKS* lookups #34

Closed lispnik closed 5 years ago

lispnik commented 5 years ago
(with-iup ()
  (let* ((button (button :title "Interesting" :action 'foo))
     (callback (callback button :action)))
    callback))

Should return 'FOO, but doesn't because key used to lookup doesn't match.

It's a bit of a bummer, this one, because the key includes the package name of the control (e.g. IUP::TREE-MAP_CB and IUP::CONTROLS::CELLS-MOUSECLICK_CB), but there's no non-hacky way to get that package information from the control.

lispnik commented 5 years ago

Instead of passing around CFFI:FOREIGN-POINTERs for the handles, create a CLOS class that wraps the pointer and includes handy metadata like the package it came from. Might be an opportunity to include a handy PRINT-OBJECT method to display things like IUP class, etc. This is a pretty big change system wide though.

lispnik commented 5 years ago

Actually, just make it a keyword. Control class is unique across iup modules