Re: using a GArray as a class property



On Sat, 2003-08-09 at 01:39, Will Webekind wrote:
I'd like to use a GArray as a property of a class, but it doesn't look
to me like it can be done.  g_param_spec_boxed wants a type derived from
G_TYPE_BOXED as an argument, but GArray doesn't seem to be registered with
the type system.  There aren't any examples of GParamSpec's defined with
g_param_spec_pointer in the GTK library, so I'm not when to use this.  If
GArrays can be used as properties I'd appreciate it if someone could tell
me how.

The general idea of a property is that it tells enough about the
property for the property to be used from a GUI builder or language
binding. This explains both:

 - Why we generally don't use 'G_TYPE_POINTER' paramspecs in GTK+
 - Why there is no GArray paramspec. (A GArray of what?)

So, you have a couple of options:

 - Register a boxed type for "array of blah"
 - Use a pointer paramspec; it will work fine if you only
   ever want to use the property from C

Regards,
                                        Owen





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