Catching "destroy" signals



Hi guys,

I'm developing my first "big" gtk-2.0 app, and I'm running into plenty 
of problems. Here's one of them:

Suppose I have 2 windows, A and B. (A, in this case, is the main 
application window, and B contains some adjustments. B is not a 
transient or modal dialog but is supposed to co-exist with A).

My problem: I'd like B to 'notice' when the main application is quit. 
I'm calling gtk_main_quit() from the "destroy_event" signal handler for 
A. As soon as I do that, B gets destroyed all right (probably by some 
cleanup mechanism in gtk_main_quit()), but the handler connected to 
B's "destroy" signal doesn't get called. Why? When I specifically call 
gtk_widget_destroy() on B, the handler does get called.

I also hoped to get a bit of automatic cleanup action by using 
g_object_set_data_full() on various widgets, but the destroy 
notification funcs never get called when these widgets get destroyed. I 
noticed this when I cleverly did a 

g_object_set_data_full(G_OBJECT(A), "some key", B, gtk_widget_destroy);

hoping to activate B's "destroy" handler this way, but to no avail.

BTW, what's the difference between the "destroy" and 
the "destroy_event" signals? The "destroy_event" doesn't seem to ever 
get emitted.

Thanks, 
--Daniel

____________________________________________________
    This mail was sent through PHYSnet-WebMailer
       http://www.PHYSnet.uni-hamburg.de/mail




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