Re: [gtk-list] Once again, destroy signal in windows...





On Fri, 12 Sep 1997, Federico Mena wrote:

> Hello all, especially Peter :-)
> 
> I would like to present a "really close?" sort of dialog when the
> user attempts to close a window.  I have tried:
> 
> 	- Connecting to the destroy signal and stopping the emission.
> 	  This seems to work the first time the user tries to delete
> 	  the window, but not later.
> 
> 	- Connecting to the delete_event signal and trying to stop it.
> 	  This doesn't work.
> 
> I would like to know the Right Way to handle this.  Seems like an
> important thing to me.

The problem is that in gtk_main_iteration, when the event is GDK_DELETE or
GDK_DESTROY, it always does a gtk_widget_destroy after the call to
gtk_widget_event. 

I'm not sure what's the best way to handle this. Adding a boolean return 
value to the delete and destroy signal handlers makes sense, but could 
lead to problems if there is more than handler on the signal.

Raph



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