I'm currently writing a plugin for a GTK+ Software (Pidgin). I haven't worked with GTK before, so I'm only somewhat familiar with how objects work from the documentation.
I'm creating a few thousand buttons with images on them (smileys) and storing them in a doubly linked list. Then, on user request, a portion of these buttons is showed on a dialog, organized in hboxes and vboxes. As soon as the user closes the dialog, it gets destroyed and so do the hboxes, vboxes, buttons and images. But I don't want the buttons and its images to be destroyed since I'm trying to keep them in the doubly linked list to be able to quickly show them again.
What I tried:
- Creating extra references to the buttons using g_object_ref() or g_object_ref_sink(). This did not change anything.
- Connecting to a "delete" signal which is supposed to be called before finalization. This signal isn't emitted though.
Edit: I also checked the GObject.ref_count field, and it's not going to zero. So that's not the cause of the problem.
I'd be grateful for any hints on how to keep the buttons from being destroyed as efficiently as possible