[traits] how to quit my app cleanly?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[traits] how to quit my app cleanly?

fred-2
Hi All,

I do have and use a "Quit" item in the menu of my app, that quits
cleanly my app (i.e. stopping all running threads for instance).

But how can I detect that the "x" icon in the window (top right) has
been clicked, in order to quit the app cleanly too?

TIA

Cheers,

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [traits] how to quit my app cleanly?

Brad Buran
I had a similar use case and created a subclass of the Handler for my application and overrode the close() method.  It captures cases where the user clicks the "X" (at least in Qt4).  You'd probably want the closed() method though.

See the docs: http://code.enthought.com/projects/files/ETS32_API/enthought.traits.ui.handler.Handler.html

Brad

On Thu, Apr 22, 2010 at 10:14 AM, Fred <[hidden email]> wrote:
Hi All,

I do have and use a "Quit" item in the menu of my app, that quits
cleanly my app (i.e. stopping all running threads for instance).

But how can I detect that the "x" icon in the window (top right) has
been clicked, in order to quit the app cleanly too?

TIA

Cheers,

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [traits] how to quit my app cleanly?

fred-2
Le 22/04/2010 17:38, Brad Buran a écrit :
> I had a similar use case and created a subclass of the Handler for my
> application and overrode the close() method.  It captures cases where
> the user clicks the "X" (at least in Qt4).  You'd probably want the
> closed() method though.
>
> See the docs:
> http://code.enthought.com/projects/files/ETS32_API/enthought.traits.ui.handler.Handler.html
Obvious!!! :-))

Thanks!


Cheers,

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev