Re: signals of a GtkWindow



The delete_event signal handler has a different
prototype than the destroy signal handler.  So,
you can't simply replace destroy with delete_event
in the signal connect.....

From the RDP
"delete-event"
            gboolean    user_function      (GtkWidget *widget,
                                            GdkEvent *event,
                                            gpointer user_data);
And
"destroy"   void        user_function      (GtkObject *object,
                                            gpointer user_data);

So, you see, you are probably accessing the event pointer, rather
than your user_data since it's not in the same parameter position
as in the destroy prototype.....

HTH,
Donna
----- Original Message -----
From: Ludovic et Marie Nathalie Larue <ludovic larue1 mageos com>
To: <gtk-app-devel-list gnome org>
Sent: Thursday, March 01, 2001 2:09 AM
Subject: Re: signals of a GtkWindow



Havoc Pennington wrote :

The delete_event signal corresponds to the "X" button on most window
managers.

If your WM has two options, "Close" and "Kill", the "Kill" means "kill
the app even if the app doesn't want to die", and there is no way to
recover from it. You can only recover from the delete_event.

I replaced the "destroy" by "delete_event" :
   gtk_signal_connect(GTK_OBJECT(gr->fenetre), "delete_event",
                    GTK_SIGNAL_FUNC(quitter), (gpointer) gr);
gr->fenetre is the window i want to close, and gr is a pointer to a struct
i
created to pass more than one argument to the callback 'quitter'.

When i use the "destroy" signal, i have no problem, the callback does what
i
want it to do.
But when i simply replace "destroy" by "delete_event", it doesn't work, it
is as though the pointer gr pointed to nothing. It is not the 'NULL'
pointer, but I can't access any field of my struct. They are not NULL
either, but i get an error when i want to use them.

What's wrong with the delete_event ?

Thanks for your answers

Ludo


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list






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