[Pythonmac-SIG] SIOUX Console ( was sys.exit )

Alexandre Parenteau alexp@strata.com
Thu, 31 Jan 2002 14:35:36 -0800


> What platform? Could you create a dummy embedding app that shows
> the problem so I can have a look?

It was fixed after 2.2. You incorporated the fix inside
GUSISIOUXSocket::GUSISIOUXSocket, remember ?

A work around using 2.2 is to do (prior of calling PyMac_SetConsoleHandler)
:

    // work around for a bug of Python 2.2 which draws the
    // Sioux menu even though we have a custom console
extern int console_output_state;

    console_output_state = 1;
    
    PyMac_SetConsoleHandler(PyMac_DummyReadHandler, PyMac_DummyWriteHandler,
        PyMac_DummyWriteHandler);

    PyMacSchedParams scp;
    
    PyMac_GetSchedParams(&scp);
    scp.process_events = 0;
    PyMac_SetSchedParams(&scp);

    Py_SetProgramName("maccvs");

You will note the 'scp.process_events = 0;' for maccvs. This is because if I
don't do that, MacPython 'eats' events that should be dispatched by the Mac
application (here PowerPlant). In the future however I will use the
PyMac_SetEventHandler capability.

Alex.