GNOME Bugzilla – Bug 156156
gnome_canvas_item_new() should use g_object_new_valist ()
Last modified: 2006-11-17 23:11:56 UTC
I derive from gnome_canvas_group and have gobject-properties that are construct-only. Therefore it must not use g_object_set to set the properties passes to gnome_canvas_item_new().
this is broken since at least version: 2.6.0. I've just upgraded from suse9.1 to 9.2 and not this effektivly block me from further development :-(. Please at least confirm or reject it. If it is confirmed I post a patch (allthough it seems to be simple to fix).
the problem lies in these lines (in gnome_canvas_item_new()): item = GNOME_CANVAS_ITEM (g_object_new (type, NULL)); gnome_canvas_item_construct (item, parent, first_arg_name, args); you set the properties in item_construct because the in the canvas design some fundamental properties seems to rely on a canvas instance that is constructed (wrong!). item->parent = GNOME_CANVAS_ITEM (parent); item->canvas = item->parent->canvas; unfortunaly exchanging g_object_new() with g_object_new_valist() is not enough to fix it, but it shows the broken behavious of existing properties.
Confirming. Stefan, if you can provide a bug, I'm going to test it and check it in.
this requires more extensive architectural changes, which are not worth the amount of work right now, given the popularity of the gnome-canvas and due to the fact that other canvas' will take over.
Reopening to make sure that this gets documented properly.
2006-11-18 Sven Herzberg <herzi@gnome-de.org> * libgnomecanvas/gnome-canvas.c: added documentation about how to pass construct parameters to GnomeCanvasItem implementations. Closes bug #156165 (Pointed out by Stefan Kost)