Re: [GObject] Extending properties
- From: "Tristan Van Berkom" <tristan van berkom gmail com>
- To: "Maciej Piechotka" <uzytkownik2 gmail com>
- Cc: gtk-list gnome org
- Subject: Re: [GObject] Extending properties
- Date: Tue, 14 Oct 2008 12:44:33 -0400
On Tue, Oct 14, 2008 at 4:08 AM, Maciej Piechotka <uzytkownik2 gmail com> wrote:
> For some reason I have to 'extend' the property. I.e. the parent had
> G_READABLE and the child has to have G_READABLE | G_CONSTRUCT_ONLY.
> Is such construction correct:
> GParamSpec *spec;
> g_object_class_override_property (gobject_class, PROP_FOO, "foo");
> spec = g_object_class_find_property (gobject_class, "foo");
> spec->flags |= G_PARAM_CONSTRUCT;
> Is (for GParamSpecObject) this correct:
> spec->value_type = BAR_TYPE_CHILD
> Assuming BarChild is child of the original class?
According to the docs your code is safe, although I've
always used g_object_class_install_property() directly
in a subclass if I needed to change the default or flags...
so I would say that is also safe.
] [Thread Prev