summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-05-20 11:32:00 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-05-20 11:32:00 (GMT)
commitab7fcdd770c776c728a12b8598a55e12cdb64260 (patch)
tree90c434d2f4cbc433d8453dd2a55aef24cc935595 /Mac
parent9d640a3d847ee2c7dbda0de548d3e417baebdcd1 (diff)
downloadcpython-ab7fcdd770c776c728a12b8598a55e12cdb64260.zip
cpython-ab7fcdd770c776c728a12b8598a55e12cdb64260.tar.gz
cpython-ab7fcdd770c776c728a12b8598a55e12cdb64260.tar.bz2
Added splash method (to quickly display splash screen without first
having to load a zillion extension modules)
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Modules/macosmodule.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/Mac/Modules/macosmodule.c b/Mac/Modules/macosmodule.c
index 8af6162..4780f1b 100644
--- a/Mac/Modules/macosmodule.c
+++ b/Mac/Modules/macosmodule.c
@@ -495,6 +495,25 @@ MacOS_GetErrorString(PyObject *self, PyObject *args)
return Py_BuildValue("s", PyMac_StrError(errn));
}
+static char splash_doc[] = "Open a splash-screen dialog by resource-id (0=close)";
+
+static PyObject *
+MacOS_splash(PyObject *self, PyObject *args)
+{
+ int resid;
+ static DialogPtr curdialog;
+
+ if (!PyArg_ParseTuple(args, "i", &resid))
+ return NULL;
+ if (curdialog)
+ DisposeDialog(curdialog);
+
+ curdialog = GetNewDialog(resid, NULL, (WindowPtr)-1);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
static char openrf_doc[] = "Open resource fork of a file";
static PyObject *
@@ -567,6 +586,7 @@ static PyMethodDef MacOS_Methods[] = {
{"HandleEvent", MacOS_HandleEvent, 1},
{"GetErrorString", MacOS_GetErrorString, 1},
{"openrf", MacOS_openrf, 1, openrf_doc},
+ {"splash", MacOS_splash, 1, splash_doc},
{NULL, NULL} /* Sentinel */
};