Re: removing widgets from a container



>  /* remove the old widget */
>  if ( GNOME_APP(appGlobal->contents) )
>  {
> 	gtk_container_remove (  GTK_CONTAINER
> (GNOME_APP(appGlobal)->contents->parent),
> 				GNOME_APP(appGlobal)->contents);
>  }
>
>  I discovered that after gtk_container_remove... the pointer in my
> previus struct (mystruct) is pointing to a non valid widget (for
> example, the widget name contains random data)
> 
>  So, I supose that gtk_container_remove will destroy my widgets...

gtk_container_remove() unrefs the widget, so to keep it around, do a
gtk_object_ref() before removing it.

Joe





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