Re: [gtk-list] Re: gtk_main_quit() and destruction



Tim Janik <timj@gtk.org> writes:

> > How do I make sure my "destroy" handler is invoked even in the
> > face of gtk_main_quit()?  I need it to make sure that some
> > cleanups are done (e.g. processes killed) when the windows
> > associated to them get destroyed.
> 
> for automated window destruction after gtk_main_quit() you can use:
> gtk_quit_add_destroy (1, window);

Thanks; this was exactly what I needed; I'm now using the following
idiom for top-level windows:

        self.connect ("destroy", self.destroy_hook)
        quit_add_destroy (1, self)

With this, the `destroy_hook()' method is called when I either delete
the window from the window manager, or call the `.destroy()' method
explicitly, or call gtk_main_quit().



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