From: <arj...@he...> - 2003-01-02 07:07:24
|
> Hi All, Hi, > Maybe someone can clarify this for me, I might be doing something > wrong: >=20 > * I have a DiaCanvas with a few DiaCanvasItem's that I added to it > using canvas->root and dia_canvas_groupable_add. > * This works fine, but then I want to detach these items from the > canvas, but *not* delete them. I am using = dia_canvas_groupable_remove > to do this (and I am detaching all of them). Do you own a reference to the detached item? If you created the item = with dia_canvas_item_create() you should own one, if you use = dia_canvas_group_create_item() you do *not* own a reference by default = (you should do a g_object_ref() first). > * And after that I want to add some of these elements again, but not > all of them, and not in the same order they were added before. > I try to do this using dia_canvas_groupable_add again, but it > crashes in dia_canvas_group_groupable_add, because it is trying to > use some undo information stored as a Quark in the DiaCanvasItem, > which leads the code to think (I believe) that I am trying to undo > something, and re-add the Item to a list that does not exist=20 > anymore. Hmm... This sounds weird... Could you please answer these quiestions in order to clarify this a bit = for me... - What version of DiaCanvas2 are you using? - If you set the allow_undo property to FALSE (g_object_set(canvas, = "allow_undo", FALSE, NULL);) does it still happen then? I can't think of = any reason the canvas should think you're undoing something...=20 - The second time you add the canvas item, is it still a valid object = (do you own a reference)? You can check that easely by printing the = value of G_OBJECT(item)->ref_count. - Did you create the items you added yourself, or are these the items = from the library (e.g. DiaCancasLine, DiaCanvasBox)? - I would be very interested in a test case that exposes this possible = bug. Could you create a simple example? Thanks in advance, Arjan -------------------------------------------------------------------------= ------- |