mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
- Moved interrupt code to macglue.c
- Added possibility to turn off mainloop event handling - Check interrupts even when not handling events - Be more carefulabout which events we want - Use different method to determine fg/bg
This commit is contained in:
parent
9fc3989c66
commit
ee23d6ec87
3 changed files with 148 additions and 21 deletions
|
@ -27,6 +27,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "Python.h"
|
||||
#include "macglue.h"
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
static PyObject *MacOS_Error; /* Exception MacOS.Error */
|
||||
|
||||
|
||||
|
@ -188,6 +190,18 @@ MacOS_SetScheduleTimes(PyObject *self, PyObject *args)
|
|||
return Py_None;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
MacOS_EnableAppswitch(PyObject *self, PyObject *args)
|
||||
{
|
||||
int enable;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i", &enable))
|
||||
return NULL;
|
||||
PyMac_DoYieldEnabled = enable;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
static PyMethodDef MacOS_Methods[] = {
|
||||
{"AcceptHighLevelEvent", MacOS_AcceptHighLevelEvent, 1},
|
||||
{"GetCreatorAndType", MacOS_GetCreatorAndType, 1},
|
||||
|
@ -196,6 +210,7 @@ static PyMethodDef MacOS_Methods[] = {
|
|||
{"SetHighLevelEventHandler", MacOS_SetHighLevelEventHandler, 1},
|
||||
#endif
|
||||
{"SetScheduleTimes", MacOS_SetScheduleTimes, 1},
|
||||
{"EnableAppswitch", MacOS_EnableAppswitch, 1},
|
||||
{NULL, NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue