Closed daym closed 3 years ago
Perhaps you could try wrapping your procedure in a closure. IIRC all you'd need would be support for storing it in a GValue, no?
Yes, storing it in a GValue
should be enough.
Do you mean GClosure
? Is it supported in guile-gi
to store a Guile procedure in a GClosure
?
G_TYPE_CLOSURE
seems to be missing, but one can use <GClosure>
. Fine.
(gi types)
should export procedure->closure
if I'm not mistaken.
Indeed, it works with that! Maybe I should read more guile-gi
documentation--sorry.
After having stored a procedure into a treeview cell like this, how do I get it back out so I can call it?
procedure->closure
makes a GClosure
which means I cannot return a guile function (in this case a guix <package>
record) from my function.
Is there another way to store Guix <package>
s into a tree?
I don't think, that use case is currently supported. You need to retrieve Guix records from the closure for further low-level processing, am I correct? In other words, you can't restrict yourself to GType
d structures here, can you?
I feel as though using scm->pointer
and pointer->scm
from (system foreign)
might be your safest bet here.
It would be nice if one could store a guile function (or whatever) in a
GtkTreeStore
column.