How to define a structure of Gtk in perl

There're two ways to do it. A structure of C can be translate into a perl array or hash table. DEFL support hash table only currently. It's preferrable because you can referen the members of data structures by name instead of index. However, the overhead of the array reference is much less than that of hash table reference.

An example of structure is shown below.

Example 3. An example of structure

(define-struct GdkColor
        (members
                (pixel  gulong)
                (red    gushort)
                (green  gushort)
                (blue   gushort)
        )
)

Two functions will be generated from this statement. They are newSVGdkColor(GdkColor *value) and SvGdkColor(SV *value, GdkColor *dest).

If you choice to implement the data structure as an array of perl, you must write these two functions by youself and you don't need to put the above example in yor DEFL file.