Calling gtk_notebook_get_menu_label_text () in a for loop

2006-12-04 Thread Colossus
Hi,

I'm in need of calling gtk_notebook_get_menu_label_text() in a for 
loop to know if an archive is already open in a page. Each menu label 
page does contain the archive name. Since from the doc I read the 
string is owned by the widget and must not be freed will I produce
memory leaks if I call gtk_notebook_get_menu_label_text() repeatedly?

-- 
Colossus
Xarchiver, a Linux GTK+2 only archive manager - http://xarchiver.xfce.org
Xscreencast, a DE independent desktop session recorder - 
http://xscreencast.berlios.de
Cpsed, a Linux OpenGL 3D scene editor - http://cpsed.sourceforge.net
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Calling gtk_notebook_get_menu_label_text () in a for loop

2006-12-04 Thread Yeti
On Mon, Dec 04, 2006 at 10:23:09AM +0100, Colossus wrote:
 I'm in need of calling gtk_notebook_get_menu_label_text() in a for 
 loop to know if an archive is already open in a page.

If you have to scan some widgets and parse their labels to
find out whether an archive is already displayed somewhere,
you should primarily rethink your data structures...

 Each menu label 
 page does contain the archive name.

...not only because this is the presentational layer and it
can change easily (e.g. you find something should be
displayed differently), unlike the underlying fact what is
displayed where.

 Since from the doc I read the 
 string is owned by the widget and must not be freed will I produce
 memory leaks if I call gtk_notebook_get_menu_label_text() repeatedly?

If it says the string is owned by the widget, it means it is
not your business to free it or otherwise mess with it (and
if you try, the compiled should warn you, because the return
type is const gchar*).  It is *owned* by the widget, and
therefore the widget knows when and how to free it.

Yeti


--
Whatever.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list