The varargs lists also add a bit of confusion to the C++ constructors
too. Although, for C++ my original idea was to go through and add
extra hand-coded constructors for the extra arguments.
As to the parent, I was going to make an extra set of constructors that didn't require a parent. As passing a Glib::RefPtr<GooCanvas::Item>() to indicate no parent seems rather silly.
Anyway, I'll take a look at the new format later this afternoon. >From what I've read it looks like it could reall make things interesting.
On Ter, 2006-10-10 at 14:24 +0100, Damon Chaplin wrote:
> o I've standardized the item creation functions so they all take a
> parent item, any required specific arguments, then pairs of
> object properties.
The current constructor for GooCanvasEllipse looks like this:
goo_canvas_ellipse_new (GooCanvasItem *parent,
const char *first_property;
item = g_object_new (GOO_TYPE_CANVAS_ELLIPSE, NULL);
ellipse = (GooCanvasEllipse*) item;
ellipse_data = ellipse->ellipse_data;
ellipse_data->center_x = center_x;
ellipse_data->center_y = center_y;
ellipse_data->radius_x = radius_x;
ellipse_data->radius_y = radius_y;
va_start (var_args, radius_y);
first_property = va_arg (var_args, char*);
g_object_set_valist ((GObject*) item, first_property, var_args);
goo_canvas_item_add_child (parent, item, -1);
From the point of view of Python language bindings this type of
constructor poses some problems for subclassing. The problem is briefly
described in . Basically, we need all constructor parameters to
exist also as GObject properties. In the particular case, all
constructor parameters in GooCanvasEllipse are also available as GObject
properties, except "parent". In GooCanvasItems in general a "parent"
property is missed. Even Gtk widges have a "parent" property, so I
don't think this is some crazy idea...
Gustavo J. A. M. Carneiro
<email@example.com> < firstname.lastname@example.org>
The universe is always one step beyond logic.
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
Goocanvas-devel mailing list