]> granicus.if.org Git - python/commitdiff
Added PyMac_OutputSeen(), which acknowledges all current output in the stdio window...
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 19 Oct 2000 22:02:16 +0000 (22:02 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 19 Oct 2000 22:02:16 +0000 (22:02 +0000)
Mac/Include/macglue.h
Mac/Modules/macosmodule.c
Mac/Python/macmain.c

index 3a251e154476c519c79a5d0e3ebe225ed0c1eb5b..372871e288d9ff84e3d9f071966a5699f5c4a6ca 100644 (file)
@@ -129,6 +129,7 @@ int PyMac_setfiletype(char *, long, long);          /* Set file creator and type */
 /* from macmain.c: */
 void PyMac_Exit(int);
 void PyMac_InitApplication(void);
+void PyMac_OutputSeen(void);
 #ifdef USE_MAC_APPLET_SUPPORT
 void PyMac_InitApplet(void);
 #endif
index 339de1a162bc2db121341a26326cec925570fed2..b3dec5400d18097457e471238c6d6cc62faf1605 100644 (file)
@@ -691,6 +691,18 @@ MacOS_KeepConsole(PyObject *self, PyObject *args)
        return Py_None;
 }
 
+static char OutputSeen_doc[] = "Call to reset the 'unseen output' flag for the keep-console-open option";
+
+static PyObject *
+MacOS_OutputSeen(PyObject *self, PyObject *args)
+{
+       if (!PyArg_ParseTuple(args, ""))
+               return NULL;
+       PyMac_OutputSeen();
+       Py_INCREF(Py_None);
+       return Py_None;
+}
+
 static PyMethodDef MacOS_Methods[] = {
 #if !TARGET_API_MAC_CARBON
        {"AcceptHighLevelEvent",        MacOS_AcceptHighLevelEvent, 1,  accepthle_doc},
@@ -711,6 +723,7 @@ static PyMethodDef MacOS_Methods[] = {
        {"MaxBlock",            MacOS_MaxBlock,         1,      MaxBlock_doc},
        {"CompactMem",          MacOS_CompactMem,       1,      CompactMem_doc},
        {"KeepConsole",         MacOS_KeepConsole,      1,      KeepConsole_doc},
+       {"OutputSeen",          MacOS_OutputSeen,       1,      OutputSeen_doc},
        {NULL,                          NULL}            /* Sentinel */
 };
 
index 8d2d8f74bc975ca1a760370ebba9092eac5fe9ac..a96af4b446272f607cd46a5ea5b64849e978a35b 100644 (file)
@@ -538,6 +538,15 @@ Py_Main(argc, argv)
        /*NOTREACHED*/
 }
 
+/*
+** Reset the "unseen output" flag
+*/
+void
+PyMac_OutputSeen()
+{
+       gusisioux_state = GUSISIOUX_STATE_LASTREAD;
+}
+
 /*
 ** Terminate application
 */