How to I catch the Main Window Closing ?

I want to catch the Main Window Closing, because I must stop an working
thread, before I allow the closing.

Help me: how to I register an OnCloseQuery like procedure ?

Thx:
KK

Hello wx community,

While trying to make my application more Mac-compliant,
I came across the following problem:
The application is document-based, i.e. for each document I open
one (or several) windows.
On e.g. Linux, you start the application with the documents you want to see.
On a Mac, you can start the application by opening one or more documents.
This works as expected.
Now I also want the possibility to start the application first, and then
open the document, which should interact with my application.
I know the application receives some Apple Event (odoc), but is a wx event sent,
or what else can I do ?

Pim Buurman

I spent a long time trying to figure this out, but for GURL apple
events, no ODOC ones.

I wrote up my solution at:
  http://wiki.wxpython.org/index.cgi/Catching_20AppleEvents_20in_20wxMAC

But I'm not positive this will work for ODOC events, because I think
the event loop for wxMac is already trapping them, and calling
wxApp->MacOpenFile(). So you would have to either wait for
MacOpenFile() to be added to wxPyApp, or add it yourself.

See wxWindows/src/mac/app.cpp for more clues.

Jason

···

On Mon, Jun 23, 2003 at 03:49:51PM +0200, Pim Buurman wrote:

While trying to make my application more Mac-compliant,
I came across the following problem:
The application is document-based, i.e. for each document I open
one (or several) windows.
On e.g. Linux, you start the application with the documents you want to
see.
On a Mac, you can start the application by opening one or more
documents.
This works as expected.
Now I also want the possibility to start the application first, and then
open the document, which should interact with my application.
I know the application receives some Apple Event (odoc), but is a wx
event sent,
or what else can I do ?

Very simple, you only need to add an EVT_CLOSE event handler to your main
frame.

Guillaume

-----Message d'origine-----

···

De : Krisztian Kepes [mailto:Kepes.Krisztian@peto.hu]
Envoye : lundi 23 juin 2003 13:51
A : wxPython-users@lists.wxwindows.org; <Python Tutor List
Objet : [wxPython-users] How to I catch the Main Window Closing ?

I want to catch the Main Window Closing, because I must stop an working
thread, before I allow the closing.

Help me: how to I register an OnCloseQuery like procedure ?

Thx:
KK

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org