gtk_main nesting, and how to free/destroy widgets



Hi,

Does there always need to be at least one gtk_main active, or is it ok
to do call gtk_main after gtk_main_quit is called on the inner most
loop? And if so, do you have to call gtk_init again before you call
gtk_main after the inner most loop has quit?

Also. what is the proper way to free/destroy widgets?

For example I have a widget from gtk_window_new , and I add a vbox to
its container, and to that vbox I add buttons etc.
I dont want the window anymore but still want the vbox. So should I do
gtk_container_remove to remove the box and then gtk_widget_destroy on
the window?

And when I am finished with the box, do I call gtk_widget_destroy on
it? Will this destory all its sub widgets, or do I have to call
gtk_widget_destroy under it (I mean buttons packed in the box)?

I am trying to ensure I have no memory leaks, as my program creates
and throws away alot of window and widgets, but I am not sure I am
doing it right.

Thanks,
Dan



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