]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added GetAuxiliaryControlRecord and SetControlColor, there was no good
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 15 Aug 1997 14:32:18 +0000 (14:32 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 15 Aug 1997 14:32:18 +0000 (14:32 +0000)
reason they were excluded.

Mac/Modules/ctl/Ctlmodule.c
Mac/Modules/ctl/ctlscan.py
Mac/Modules/ctl/ctlsupport.py

index bbf51284f63af88113fe4c737fe1e0e80c3b9466..654f671c305e3ec8d3b121381272720e177c3980 100644 (file)
@@ -429,6 +429,39 @@ static PyObject *CtlObj_GetControlReference(_self, _args)
        return _res;
 }
 
+static PyObject *CtlObj_GetAuxiliaryControlRecord(_self, _args)
+       ControlObject *_self;
+       PyObject *_args;
+{
+       PyObject *_res = NULL;
+       Boolean _rv;
+       AuxCtlHandle acHndl;
+       if (!PyArg_ParseTuple(_args, ""))
+               return NULL;
+       _rv = GetAuxiliaryControlRecord(_self->ob_itself,
+                                       &acHndl);
+       _res = Py_BuildValue("bO&",
+                            _rv,
+                            ResObj_New, acHndl);
+       return _res;
+}
+
+static PyObject *CtlObj_SetControlColor(_self, _args)
+       ControlObject *_self;
+       PyObject *_args;
+{
+       PyObject *_res = NULL;
+       CCTabHandle newColorTable;
+       if (!PyArg_ParseTuple(_args, "O&",
+                             ResObj_Convert, &newColorTable))
+               return NULL;
+       SetControlColor(_self->ob_itself,
+                       newColorTable);
+       Py_INCREF(Py_None);
+       _res = Py_None;
+       return _res;
+}
+
 static PyObject *CtlObj_as_Resource(_self, _args)
        ControlObject *_self;
        PyObject *_args;
@@ -501,6 +534,10 @@ static PyMethodDef CtlObj_methods[] = {
         "(SInt32 data) -> None"},
        {"GetControlReference", (PyCFunction)CtlObj_GetControlReference, 1,
         "() -> (SInt32 _rv)"},
+       {"GetAuxiliaryControlRecord", (PyCFunction)CtlObj_GetAuxiliaryControlRecord, 1,
+        "() -> (Boolean _rv, AuxCtlHandle acHndl)"},
+       {"SetControlColor", (PyCFunction)CtlObj_SetControlColor, 1,
+        "(CCTabHandle newColorTable) -> None"},
        {"as_Resource", (PyCFunction)CtlObj_as_Resource, 1,
         "Return this Control as a Resource"},
        {"DisposeControl", (PyCFunction)CtlObj_DisposeControl, 1,
index d3e185ec259d059edd0e13400f9fa78c9a5a0813..1f870c929c80132144abdc9a04541a8b157b66d1 100644 (file)
@@ -39,8 +39,6 @@ class MyScanner(Scanner):
                return [
                        'ProcPtr',
                        'ControlActionUPP',
-                       'CCTabHandle',
-                       'AuxCtlHandle',
                        ]
 
        def makerepairinstructions(self):
index f7f5df28e4fb10e767e4b18e0a59226a73c18a55..50efd9466128d386da82c261cd2227b5f848b41f 100644 (file)
@@ -29,6 +29,8 @@ ControlRef = ControlHandle
 ExistingControlHandle = OpaqueByValueType(OBJECTTYPE, "CtlObj_WhichControl", "BUG")
 
 RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
+CCTabHandle = OpaqueByValueType("CCTabHandle", "ResObj")
+AuxCtlHandle = OpaqueByValueType("AuxCtlHandle", "ResObj")
 ControlPartCode = Type("ControlPartCode", "h")
 DragConstraint = Type("DragConstraint", "h")