gtk_container_remove移除容器内组件
gtk_container_remove ()
void gtk_container_remove (GtkContainer *container,
GtkWidget *widget);
Removes widget from container. widget must be inside container. Note that container will own a reference to widget, and that this may be the last reference held; so removing a widget from its container can destroy that widget. If you want to use widget again, you need to add a reference to it while it's not inside a container, using g_object_ref(). If you don't want to use widget again it's usually more efficient to simply destroy it directly using gtk_widget_destroy() since this will remove it from the container and help break any circular reference count cycles.
container :
a GtkContainer
widget :
a current child of container
为了移除后还可以继续使用组件,使用g_object_ref增加对象的引用计数
与之对应的是g_object_unref,减少对象引用计数,释放对象