[946] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

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

daemon@ATHENA.MIT.EDU (Raph Levien)
Fri Sep 12 11:39:10 1997

Date: Fri, 12 Sep 1997 08:35:06 -0700 (PDT)
From: Raph Levien <raph@acm.org>
To: Federico Mena <federico@nuclecu.unam.mx>
cc: gtk-list@redhat.com
In-Reply-To: <199709120634.BAA15200@nuclecu.unam.mx>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com



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

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post