Re: Installing properties for arbitrary structure?



On Thu, 2007-10-18 at 22:52 -0700, Lawrence Nolin wrote:
> To install a property for fundamental types such as integers, chars,
> etc, you can use g_param_spec_*() and g_object_class_install_property().
> My question is: how do I create a GParamSpec and install a property for
> an arbitrary non-GObject C structure? I'm worried that values stored in
> the properties won't be garbage collected. I could wrap the structures
> in GObject subclasses and use g_param_spec_gobject, but that seems
> overkill. Any help?

Use GBoxed[1] and g_param_spec_boxed().

1.
http://library.gnome.org/devel/gobject/stable/gobject-Boxed-Types.html

Ed



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