Re: Calling gtk_notebook_get_menu_label_text () in a for loop



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.



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