Re: Possible bug: gtk_tree_item_remove_subtree()



On Mon, 20 Apr 1998 adustman@comstar.net wrote:

> A quick inspection of gtktreeitem.c:1010-1016 reveals:
> 
>   if (item->pixmaps_box)
>     {
>       gtk_container_remove (GTK_CONTAINER (item->pixmaps_box), 
> 			    item->minus_pix_widget);
>       gtk_container_add (GTK_CONTAINER (item->pixmaps_box), 
> 			 item->plus_pix_widget);
>     }

A similar code fragment is in gtk_real_tree_item_collapse() (910-916):

      if (tree_item->pixmaps_box)
	{
	  gtk_container_remove (GTK_CONTAINER (tree_item->pixmaps_box), 
				tree_item->minus_pix_widget);
	  gtk_container_add (GTK_CONTAINER (tree_item->pixmaps_box), 
			     tree_item->plus_pix_widget);
	}

Since the collapse occurs before remove_subtree would be called, this
would indeed seem to be a bug and explains the error messages: It can't
remove the mius_pix_widget because is is not a child of the pixmaps_box,
and it can't add plus_pix_widget to pixmaps_box because it is already a
child of pixmaps_box. So it would seem that the solution is to either a)
remove lines 1010-1016 or b) change the gtk_container_remove to remove the
child of item->pixmaps_box (i.e. don't specify a specific object, use
gtk_container_children()). I lean towards a), but there may be other
reasons to do b).

-- 
Andy Dustman                                              Charles Babbage:
ComStar Communications Corp.                          He never used Linux,
(770) 333-8779 | PGP KeyID=0xC72F3F1D                  and now, he's dead.



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