gi repository and C array



Hello

I have a C library and I try to use the gobject introspection from python

now the structure I am trying to bing is like this

struct _HklVector {
        double data[3];
};


the gir file contain this

    <record name="Vector"
            c:type="HklVector"
            glib:type-name="HklVector"
            glib:get-type="hkl_vector_get_type"
            c:symbol-prefix="vector">
      <field name="data" writable="1">
        <array zero-terminated="0" c:type="gdouble" fixed-size="3">
          <type name="gdouble" c:type="double"/>
        </array>
      </field>


but when I try to access my structure from python
I got this

from gi.repository import Hkl
v = Hkl.Vector()
print v.data
[]

so my question is why the python binding do not print
[0.0, 0.0, 0.0]


thanks for your help

Frederic


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]