On Fri, 7 Sep 2018 23:03:09 +0200, Mike Wey wrote:
[…]
Unfortunately there is currently no easy way to access the gType of the
thing contained in the Value asValue.getType
or in this caseobject.getType
returns the GType of the Value its self.The contained type is accessible in the C struct as a workaround:
object.getValueStruct().gType;
getValueStruct
returns a GValue*
which doesn't have a gType
method or function. :-(
The actual setting of the value is handled by the gobject.Value
constructor:
https://github.com/gtkd-developers/GtkD/blob/master/generated/gtkd/gobject/Value.d#L86
So it's ultimately stored as a pointer.We will need to ad a
get
template toValue
to handle this properly,
but a pointer to the C version can be obtained withValue.getPointer
.
[…]
I tried object.getPointer
but get an exception that the contained value is not a pointer. So at the heart of my problem is what is being done with:
setValue(iter, ColumnNumber.fontDescription, fontDescription);
fontDescription
is a variable of type PgFontDescription
which is a class so fontDescription
should be a reference to a heap allocated object. Is setValue
definitely going to wrap that as a Value
rather than an int
? It certainly appears not to be wrapping an Object
or a Pointer
in the Value
.
Apologies for seeming to drag this one out, I am not sure how to use the code to find out what is happening.