Fwd: [pygtk] Disable/enable window close button

Frédéric frederic.mantegazza at gbiloba.org
Wed Jun 25 23:57:46 WST 2008


On mercredi 25 juin 2008, Gian Mario Tagliaretti wrote:

> It does work.
>
> Returning True from "delete-event" stops the signal emission and the
> windows stays open, you probably want to give the user another meaning
> to close the window, like popping up a message dialog asking if they
> really want to close or something like that. The Dialog widget works
> in a slightly different way, depending if you use it modal or not
> modal, see gtk.Dialog class in the reference manual for more details.
>
> Also the Pygtk FAQ may help, IIRC there are examples on this subject.

Strange. I can't get it work (I tried different methods, posted here or 
there). The callback is called, but even returning True does not prevent 
the dialog to be closed. Anyway, I added a proper shutdown in this 
callback, so I clean things up before quitting the dialog.

Thanks.

-- 
    Frédéric

    http://www.gbiloba.org


More information about the pygtk mailing list