Re: gtk_object_setv()



On 13 Dec 2000, Martin Baulig wrote:

> Hi,
> 
> now that gtk_object_setv() is gone - how do I fix code which is
> still using it, GObject doesn't have any function which allows you
> to set an array of GtkArg's ?

GtkArg is deprectaed, there's just a minor portion of compatibility code
left to let get_arg/set_arg method implementations working (and the
gtk_signal_*() functions that expose GtkArgs).
setting/getting object properties now fully works on top of GValue and
GParamSpec, the same is not yet true for container<->child args, but will
be soon, and at that point, we'll even get rid of gtkarg.[hc].

looking at libgnomeui, the only functions that actually expose GtkArg are:

/* Same as above, with parsed args */
GnomeCanvasItem *gnome_canvas_item_newv (GnomeCanvasGroup *parent, GtkType type,
                                         guint nargs, GtkArg *args);
void gnome_canvas_item_constructv (GnomeCanvasItem *item, GnomeCanvasGroup *parent,
                                   guint nargs, GtkArg *args);
/* Same as above, with parsed args */
void gnome_canvas_item_setv (GnomeCanvasItem *item, guint nargs, GtkArg *args);

all of which have regular ellipsis variants that should use g_object_new_valist()
(i.e. like g_object_new() is implemented).
these functions should simply vanish, they provide no added functionality over
the g_object_* creation functions.
gnome_canvas_item_construct* was never a real constructor in the first place,
since you could always create constructed canvas items with gtk_object_new,
and later add that to their parents, so gnome_canvas_item_construct* should
fully go away, just add a GnomeCanvasItem::parent argument (not a CONSTRUCT
though, because it really isn't a construction argument).

> 
> -- 
> Martin Baulig

---
ciaoTJ





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