gtk_container_remove?




Short description of the problem. I have a dynamically allocated struct
that contains widget pointers. At various points in my code I want to
change the widget in one of my containers ( for arguments sake lets say
a button ). Using these widget pointers I can use gtk_container_remove
to remove the widget from the container and then use gtk_container_add
to stick a new one in the container. For both of these operations I use
widgets that were created earlier in the code with their pointers saved
in the dynamic struct. Every thing works as expected the first time
through when I remove one widget and stick another in. But when I want
to change it back to the original widget I get all kinds of gtk errors
about object->ref_count > 0 failed. What I think this means is that when
I did the gtk_container_remove the widget was destroyed verses just
removed from the container. Am I right in this? If so is there a way to
remove a widget from a container without destroying it. I really don't
want to have to create the widgets each time I want to change them I
just want to create them once and then switch them out as needed as this
will be happening pretty often.

Richard Jackson

If you need it I can put together a sample piece of code demonstrating
what I'm trying to do.



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