mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Added as_Resource() method to convert ctl object to res object
This commit is contained in:
parent
80adc227d2
commit
5d56f4b403
3 changed files with 21 additions and 0 deletions
|
@ -432,6 +432,16 @@ static PyObject *CtlObj_GetControlReference(_self, _args)
|
|||
return _res;
|
||||
}
|
||||
|
||||
static PyObject *CtlObj_as_Resource(_self, _args)
|
||||
ControlObject *_self;
|
||||
PyObject *_args;
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
|
||||
return ResObj_New((Handle)_self->ob_itself);
|
||||
|
||||
}
|
||||
|
||||
static PyMethodDef CtlObj_methods[] = {
|
||||
{"DisposeControl", (PyCFunction)CtlObj_DisposeControl, 1,
|
||||
"() -> None"},
|
||||
|
@ -477,6 +487,8 @@ static PyMethodDef CtlObj_methods[] = {
|
|||
"(SInt32 data) -> None"},
|
||||
{"GetControlReference", (PyCFunction)CtlObj_GetControlReference, 1,
|
||||
"() -> (SInt32 _rv)"},
|
||||
{"as_Resource", (PyCFunction)CtlObj_as_Resource, 1,
|
||||
"Return this Control as a Resource"},
|
||||
{NULL, NULL, 0}
|
||||
};
|
||||
|
||||
|
|
8
Mac/Modules/ctl/ctledit.py
Normal file
8
Mac/Modules/ctl/ctledit.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
as_resource_body = """
|
||||
return ResObj_New((Handle)_self->ob_itself);
|
||||
"""
|
||||
|
||||
f = ManualGenerator("as_Resource", as_resource_body)
|
||||
f.docstring = lambda : "Return this Control as a Resource"
|
||||
|
||||
methods.append(f)
|
|
@ -82,6 +82,7 @@ Method = OSErrMethodGenerator
|
|||
functions = []
|
||||
methods = []
|
||||
execfile(INPUTFILE)
|
||||
execfile('ctledit.py')
|
||||
|
||||
# add the populated lists to the generator groups
|
||||
for f in functions: module.add(f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue