mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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.
This commit is contained in:
parent
6a508aef7d
commit
e180d99280
9 changed files with 957 additions and 9 deletions
|
@ -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}
|
||||
};
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue