Re: weird gtk_timeout_add ...
- From: Havoc Pennington <hp redhat com>
- To: peter rottengatter de
- Cc: gtk-app-devel-list gnome org
- Subject: Re: weird gtk_timeout_add ...
- Date: 06 Dec 2001 19:36:07 -0500
Peter Rottengatter <peter rottengatter de> writes:
Havoc Pennington wrote about "weird gtk_timeout_add ..." :
Hmmm. What I wondered: I have an optionmenu that has some menu attached.
I need to change a lot of the menu, so I build a new one, and attach it
with gtk_option_menu_set_menu. I'd guessed that would create a leak, so I
looked for some way to get rid of the old menu properly. I think, calling
gtk_option_menu_remove_menu prior to attaching the new one does the job.
But I'm still not sure if something needs to be freed. Do I need to
foo_destroy the thing ?
Ah. I left out the important detail of the "floating" flag for
GtkObject. GtkObject memory management is documented in both 1.2 and
2.0 docs, differently each time, so maybe one is clearer:
http://developer.gnome.org/doc/API/gtk/gtkobject.html
http://developer.gnome.org/doc/API/2.0/gtk/gtkobject.html
OK, that makes the "floating" concept clear enough. However, I still don't
know, if gtk_option_menu_set_menu is like gtk_container_add in that it
gtk_object_sink's the attached menu. Your wording seems to indicate that
this is so, but it's not clear to me yet.
It is like gtk_container_add(), yes. Anytime you pass an object to an
owner (set or add an object), it should get sunk.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]