Re: GtkOrientable vs property "override"

Kevin Ryde wrote:
Is the GtkOrientable bit about making a property "override" still

Yes, I committed Emmanuel's patch without the _ADD_INTERFACE xsub. So any attempt to implement Gtk2::Orientable in a subclass will fail[1]. The bug entries are <> and <>.

Coming to understand it very very slowly ... is it about making
g_object_class_override_property() available so a perl-code widget can
create itself a property which takes the pspec of the GtkOrientable?

Yes. The basic open question is when do we want g_object_class_override_property() to happen. Do we want it to happen automatically whenever a subclass is registered that implements Gtk2::Orientable but which doesn't have its own "orientation" property? That is, do we want

  use Glib::Object::Subclass
    interfaces => [ Gtk2::Orientable:: ];

to call g_object_class_override_property() for "orientation"?

Or do we want to make the programmer actively ask for the property override, using a new syntax?

  use Glib::Object::Subclass
    properties => [ "orientation" ], # override for Gtk2::Orientable
    interfaces => [ Gtk2::Orientable:: ];

The first approach should be easy to implement and doesn't need new syntax, but it is rather automatic. It would mean that [GS]ET_PROPERTY were called for properties ("orientation" in the example) that the programmer didn't mention at all.

[1] With an obscure error message about _ADD_INTERFACE not being found. We should try to provide better diagnostics.

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