diff options
Diffstat (limited to 'Mac/Modules/ctl/Ctlmodule.c')
-rw-r--r-- | Mac/Modules/ctl/Ctlmodule.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Mac/Modules/ctl/Ctlmodule.c b/Mac/Modules/ctl/Ctlmodule.c index d1deee8..3648a55 100644 --- a/Mac/Modules/ctl/Ctlmodule.c +++ b/Mac/Modules/ctl/Ctlmodule.c @@ -45,6 +45,7 @@ extern PyObject *WinObj_WhichWindow(WindowPtr); #include <Controls.h> #define as_Control(h) ((ControlHandle)h) +#define as_Resource(ctl) ((Handle)ctl) #define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */ @@ -1008,9 +1009,13 @@ static PyObject *CtlObj_as_Resource(_self, _args) PyObject *_args; { PyObject *_res = NULL; - - return ResObj_New((Handle)_self->ob_itself); - + Handle _rv; + if (!PyArg_ParseTuple(_args, "")) + return NULL; + _rv = as_Resource(_self->ob_itself); + _res = Py_BuildValue("O&", + ResObj_New, _rv); + return _res; } static PyObject *CtlObj_DisposeControl(_self, _args) @@ -1400,7 +1405,7 @@ static PyMethodDef CtlObj_methods[] = { {"GetControlDataSize", (PyCFunction)CtlObj_GetControlDataSize, 1, "(ControlPartCode inPart, ResType inTagName) -> (Size outMaxSize)"}, {"as_Resource", (PyCFunction)CtlObj_as_Resource, 1, - "Return this Control as a Resource"}, + "() -> (Handle _rv)"}, {"DisposeControl", (PyCFunction)CtlObj_DisposeControl, 1, "() -> None"}, {"TrackControl", (PyCFunction)CtlObj_TrackControl, 1, |