Re: delete-event of GtkWidget



On Sat, 20 Jan 2007 05:34:27 +0000, tomas tuxteam de wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Jan 19, 2007 at 06:52:03PM +0100, Enrico TrÃger wrote:
Hi all,

when I write big dialogs, I create it only once, keep the pointer to
the dialog and show it everytime I need it. In the response
callback I just use gtk_widget_hide to let the dialog disappear.
This works as expected and all is fine.

On my Debian Etch(same for Sarge) I don't need to handle the
delete-event signal of the dialog. If it is triggered the dialog
just disappears and until now I thought it is just hidden. But
according to the API documenation the dialog should be actually
destroyed [...]

I didn't understand exactly. Do you mean that you *don't* handle the
delete event and still keep a pointer to the widget? And then the
widget is hidden for you and you can re-show it later?
I connected to the delete-event and registered gtk_widget_hide as
callback. Re-showing(gtk_widget_show) worked in Debian and crashed in
PuppyLinux. Now, I register gtk_widget_hide_on_delete as callback and
then the widget won't be destroyed and all is fine.

If you don't handle the delete event, the widget gets marked for
destroy. Later it gets the destroy event (at this point the widget is
no longer quite functional: think of it as a last cleanup thing).
Then it goes away. Nobody guarantees you that all those things happen
immediately.
Yes, this is what one should expect and it is also written in the docs.
But at least in Debian the widget is still usable after the
delete-event.


Regards,
Enrico

--
Get my GPG key from http://www.uvena.de/pub.key


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