Re: Moving widgets from one parent to another...?

	gtk_widget_ref (vbox2);	

>	gtk_container_remove(GTK_CONTAINER(window2), vbox2);
>	gtk_container_add(GTK_CONTAINER(vbox1), vbox2);

	gtk_widget_unref (vbox2);	

by default, when you add a widget to a container, the container
takes ownership of the widget. when you then remove it, it takes
responsibility for deleting it.

adding a reference will stop this.

you can also use gtk_widget_reparent() to hide all this, IIRC.


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