summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/res
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1998-04-24 10:28:20 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1998-04-24 10:28:20 (GMT)
commite180d99280a7b7615d445a52efd63314f330e74b (patch)
tree806d4c6302ec0e534ecbf50b830339571d34bc52 /Mac/Modules/res
parent6a508aef7d024921b00a1c8fe635f19b0fa6a98f (diff)
downloadcpython-e180d99280a7b7615d445a52efd63314f330e74b.zip
cpython-e180d99280a7b7615d445a52efd63314f330e74b.tar.gz
cpython-e180d99280a7b7615d445a52efd63314f330e74b.tar.bz2
Grmpf, a lot more routines have gotten a "Mac" prefix for their
declaration, probably so the universal headers are useable on windows/unix too. Have to think of a more definite workaround later, for now we manually declare the old names in the *edit.py files.
Diffstat (limited to 'Mac/Modules/res')
-rw-r--r--Mac/Modules/res/Resmodule.c19
-rw-r--r--Mac/Modules/res/resedit.py7
2 files changed, 26 insertions, 0 deletions
diff --git a/Mac/Modules/res/Resmodule.c b/Mac/Modules/res/Resmodule.c
index 45e16a6..6eeb3b8 100644
--- a/Mac/Modules/res/Resmodule.c
+++ b/Mac/Modules/res/Resmodule.c
@@ -434,6 +434,23 @@ static PyObject *ResObj_as_Menu(_self, _args)
}
+static PyObject *ResObj_LoadResource(_self, _args)
+ ResourceObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ LoadResource(_self->ob_itself);
+ {
+ OSErr _err = ResError();
+ if (_err != noErr) return PyMac_Error(_err);
+ }
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
static PyMethodDef ResObj_methods[] = {
{"HomeResFile", (PyCFunction)ResObj_HomeResFile, 1,
"() -> (short _rv)"},
@@ -473,6 +490,8 @@ static PyMethodDef ResObj_methods[] = {
"Return this resource/handle as a Control"},
{"as_Menu", (PyCFunction)ResObj_as_Menu, 1,
"Return this resource/handle as a Menu"},
+ {"LoadResource", (PyCFunction)ResObj_LoadResource, 1,
+ "() -> None"},
{NULL, NULL, 0}
};
diff --git a/Mac/Modules/res/resedit.py b/Mac/Modules/res/resedit.py
index bffec5f..42966e4 100644
--- a/Mac/Modules/res/resedit.py
+++ b/Mac/Modules/res/resedit.py
@@ -39,3 +39,10 @@ def genresconverter(longname, shortname):
resmethods.append(genresconverter("Control", "Ctl"))
resmethods.append(genresconverter("Menu", "Menu"))
+
+# The definition of this one is MacLoadResource, so we do it by hand...
+
+f = ResMethod(void, 'LoadResource',
+ (Handle, 'theResource', InMode),
+)
+resmethods.append(f)