From 4100900059ea422e990cf75543fb2b6f175c2f59 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sun, 7 Mar 1999 20:05:20 +0000 Subject: [PATCH] Added a rewrite rule so the Str255 argument of GetControlTitle is seen as output parameter. --- Mac/Modules/ctl/Ctlmodule.c | 9 ++++----- Mac/Modules/ctl/ctlscan.py | 4 ++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Mac/Modules/ctl/Ctlmodule.c b/Mac/Modules/ctl/Ctlmodule.c index 07fff299041..42a82d9ac8c 100644 --- a/Mac/Modules/ctl/Ctlmodule.c +++ b/Mac/Modules/ctl/Ctlmodule.c @@ -462,13 +462,12 @@ static PyObject *CtlObj_GetControlTitle(_self, _args) { PyObject *_res = NULL; Str255 title; - if (!PyArg_ParseTuple(_args, "O&", - PyMac_GetStr255, title)) + if (!PyArg_ParseTuple(_args, "")) return NULL; GetControlTitle(_self->ob_itself, title); - Py_INCREF(Py_None); - _res = Py_None; + _res = Py_BuildValue("O&", + PyMac_BuildStr255, title); return _res; } @@ -952,7 +951,7 @@ static PyMethodDef CtlObj_methods[] = { {"SetControlTitle", (PyCFunction)CtlObj_SetControlTitle, 1, "(Str255 title) -> None"}, {"GetControlTitle", (PyCFunction)CtlObj_GetControlTitle, 1, - "(Str255 title) -> None"}, + "() -> (Str255 title)"}, {"GetControlValue", (PyCFunction)CtlObj_GetControlValue, 1, "() -> (SInt16 _rv)"}, {"SetControlValue", (PyCFunction)CtlObj_SetControlValue, 1, diff --git a/Mac/Modules/ctl/ctlscan.py b/Mac/Modules/ctl/ctlscan.py index 66b4f569d98..aba07c5e18b 100644 --- a/Mac/Modules/ctl/ctlscan.py +++ b/Mac/Modules/ctl/ctlscan.py @@ -83,6 +83,10 @@ def makerepairinstructions(self): ## ([("ControlActionUPP", "actionProc", "InMode")], ## [("FakeType('(ControlActionUPP)0')", "*", "*")]), + # For GetControlTitle + ([('Str255', 'title', 'InMode')], + [('Str255', 'title', 'OutMode')]), + ([("ControlHandle", "*", "OutMode")], [("ExistingControlHandle", "*", "*")]), ([("ControlRef", "*", "OutMode")], # Ditto, for Universal Headers