Re: GtkBuilder Public API - Last call



On Tue, 2007-06-12 at 18:26 -0300, Johan Dahlin wrote:

> gtkbuildable.h
> ==============
> 
> GtkBuildable is an interface which is implementable to allow a GObject
> subclass to customize the behavior of how it is going to be built.

Some of the GtkBuildable methods have very generic names which can
become problematic for language bindings that support the usual method
calling semantics.

>   void          (* set_name)            (GtkBuildable  *buildable,
>                                          const gchar   *name);
>   const gchar * (* get_name)            (GtkBuildable  *buildable);

These theoretically collide with GtkWidget::set_name and get_name.
Fortunately though, as you say, GtkWidget overrides them to make both
versions do the same.  So no big problem here.

>   void          (* add)                 (GtkBuildable  *buildable,
>                                          GtkBuilder    *builder,
>                                          GObject       *child,
>                                          const gchar   *type);

This collides with GtkContainer::add.  If you have an instance of
GtkContainer, what should instance.add(...) resolve to?  As an
alternative, add_child() comes to mind.  The name's not really
GtkBuildable specific enough either, but at least it doesn't seem to
collide with any existing method.

>   void          (* set_property)        (GtkBuildable  *buildable,
>                                          GtkBuilder    *builder,
>                                          const gchar   *name,
>                                          const GValue  *value);

This collides with GObject::set_property.  Maybe set_buildable_property?

-- 
Bye,
-Torsten




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