Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7fefed

Browse files
committed
Added GetAuxiliaryControlRecord and SetControlColor, there was no good
reason they were excluded.
1 parent f69633e commit c7fefed

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

Mac/Modules/ctl/Ctlmodule.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,39 @@ static PyObject *CtlObj_GetControlReference(_self, _args)
429429
return _res;
430430
}
431431

432+
static PyObject *CtlObj_GetAuxiliaryControlRecord(_self, _args)
433+
ControlObject *_self;
434+
PyObject *_args;
435+
{
436+
PyObject *_res = NULL;
437+
Boolean _rv;
438+
AuxCtlHandle acHndl;
439+
if (!PyArg_ParseTuple(_args, ""))
440+
return NULL;
441+
_rv = GetAuxiliaryControlRecord(_self->ob_itself,
442+
&acHndl);
443+
_res = Py_BuildValue("bO&",
444+
_rv,
445+
ResObj_New, acHndl);
446+
return _res;
447+
}
448+
449+
static PyObject *CtlObj_SetControlColor(_self, _args)
450+
ControlObject *_self;
451+
PyObject *_args;
452+
{
453+
PyObject *_res = NULL;
454+
CCTabHandle newColorTable;
455+
if (!PyArg_ParseTuple(_args, "O&",
456+
ResObj_Convert, &newColorTable))
457+
return NULL;
458+
SetControlColor(_self->ob_itself,
459+
newColorTable);
460+
Py_INCREF(Py_None);
461+
_res = Py_None;
462+
return _res;
463+
}
464+
432465
static PyObject *CtlObj_as_Resource(_self, _args)
433466
ControlObject *_self;
434467
PyObject *_args;
@@ -501,6 +534,10 @@ static PyMethodDef CtlObj_methods[] = {
501534
"(SInt32 data) -> None"},
502535
{"GetControlReference", (PyCFunction)CtlObj_GetControlReference, 1,
503536
"() -> (SInt32 _rv)"},
537+
{"GetAuxiliaryControlRecord", (PyCFunction)CtlObj_GetAuxiliaryControlRecord, 1,
538+
"() -> (Boolean _rv, AuxCtlHandle acHndl)"},
539+
{"SetControlColor", (PyCFunction)CtlObj_SetControlColor, 1,
540+
"(CCTabHandle newColorTable) -> None"},
504541
{"as_Resource", (PyCFunction)CtlObj_as_Resource, 1,
505542
"Return this Control as a Resource"},
506543
{"DisposeControl", (PyCFunction)CtlObj_DisposeControl, 1,

Mac/Modules/ctl/ctlscan.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ def makeblacklisttypes(self):
3939
return [
4040
'ProcPtr',
4141
'ControlActionUPP',
42-
'CCTabHandle',
43-
'AuxCtlHandle',
4442
]
4543

4644
def makerepairinstructions(self):

Mac/Modules/ctl/ctlsupport.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
ExistingControlHandle = OpaqueByValueType(OBJECTTYPE, "CtlObj_WhichControl", "BUG")
3030

3131
RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
32+
CCTabHandle = OpaqueByValueType("CCTabHandle", "ResObj")
33+
AuxCtlHandle = OpaqueByValueType("AuxCtlHandle", "ResObj")
3234
ControlPartCode = Type("ControlPartCode", "h")
3335
DragConstraint = Type("DragConstraint", "h")
3436

0 commit comments

Comments
 (0)