Re: Window destroy event



On Sun, 2008-11-23 at 17:16 -0200, Fabio Rafael da Rosa wrote:
> On other bindings (and plain C gtk) we have two signals for handling a
> window being destroyed: destroy and delete event. 

delete_event just tells you that the window manager's window close
button (usually an X) has been clicked. It has nothing to do with memory
management.

> As far as I understood, destroy is a GTK specific signal inherited from
> GtkWidget, right? The delete_event, on the other hand, is and event from
> the Windowing System (x11 event) . 

Yes.

> Is that correct ?
> On GTKmm, I could not find a way to connect a callback to the destroy
> signal. I have a Gtk::Window::signal_delete_event, but I could not find
> a Gtk::Window::signal_destroy . 
> How do I connect something to destroy ?

You shouldn't need to. Maybe you actually want to respond to a window
being closed. In that case you should handle the hide signal.

If for some strange reason you really want to handle the destruction of
an instance (though you should know when you are deleting things) then
you can override the class and put something in the derived constructor.

-- 
murrayc murrayc com
www.murrayc.com
www.openismus.com



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