Re: Re: Cleaning a canvas



Miguel de Icaza wrote:

> >  Here goes an small question:
> >  How can I remove all the items in a GnomeCanvas?
> >
> >  I have tried an:
> >  GList * ptr = canvas -> item_list;
> >  while (ptr != NULL)
> > {
> >  gtk_object_destroy(GTK_OBJECT(ptr -> data));
> >  ptr = ptr -> next;
> > }
> >
> > And some minor variations but it doesn't work.
>
> I would personally create a new group item, and use it as the "root"
> for all items you insert.  Then you just kill it (this will destroy
> its childs)
>
> miguel.

Thanks, that worked fine.

One more question (I haven't got the sources for the GnomeCanvas),
What does item_list store (Ok, the list of items, it sounds stupid), and
more important, how?
ie: How can I gather information about the items in a Canvas through
this structure?
Is ptr -> data a (GnomeCanvasItem *)?



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