Closed daym closed 3 years ago
(require "GObject")
(load-by-name "GObject" "Value")
(let ((v (value:init (make <GValue>) G_TYPE_INT)))
(set! (v) 42))
Note, that value:init
does copy the underlying value on return, but the following is also possible:
(let* ((v (make <GValue>))
(v2 (value:init v G_TYPE_INT)))
(set! (v) 42))
You will have to work around #96 though.
Is it possible to use
(make <GValue> #:type <GClosure>)
in order to make it pass the type to use in the call tog_value_init
, but not the value ? This would be in order to get the glib default value of that type.(Also, I don't seem to get an error or warning message on
(make <GValue> #:quoox 2)
either. Is that on purpose?)I want that in order to be able to leave cells off in a GtkTreeStore row (specifically to leave GClosure cells off) by having an empty but type-tagged GValue that I then set via
tree-store:set
. It's also possible to just not specify that cell ontree-store:set
in the first place--but still, I think the handling ofGValue
here is maybe weird. Not sure, though.C program to play with: