[pygtk] hide on delete_event()

Frédéric frederic.mantegazza at gbiloba.org
Sat Dec 20 02:19:38 WST 2008


On vendredi 19 décembre 2008, John Finlay wrote:

> > The event is called 'delete', and not 'delete-event'...

I wanted to write 'destroy' - 'destroy-event', here...

> Check the docs for the gtk.Widget to see the signals:
> http://pygtk.org/docs/pygtk/class-gtkwidget.html#signal-prototypes-gtkwi
>dget
>
> Both "delete-event" and "destroy-event" are Widget signals. "destroy" is
> a gtk.Object signal.

I think there is a mistake in the doc. The tutorial always uses "destroy" 
as name, and my tests confirm that the correct name is "destroy", 
not "destroy-event".

But the delete event name is 'delete-event'... Very strange.

> Then don't use run(), connect a callback to the "response" signal and
> put all the dialog processing in that. You still need to handle the
> "delete-event" signal to prevent the dialog closing and put the
> destroy() in the "response" signal handler assuming the close button is
> part of the dialog; if not then put it in the button's "clicked"
> handler.

Ok, I got it!

Thanks for you help.

-- 
    Frédéric

    http://www.gbiloba.org


More information about the pygtk mailing list