6 if (!PyArg_ParseTuple(_args, "s#", &buf, &len))
16 return (PyObject *)ResObj_New(h);
19 f
= ManualGenerator("Resource", resource_body
)
20 f
.docstring
= lambda: """Convert a string to a resource object.
22 The created resource object is actually just a handle.
23 Apply AddResource() to write it to a resource file.
27 # Convert resources to other things.
30 return %sObj_New((%sHandle)_self->ob_itself);
33 def genresconverter(longname
, shortname
):
35 f
= ManualGenerator("as_%s"%longname
, as_xxx_body
%(shortname
, longname
))
36 docstring
= "Return this resource/handle as a %s"%longname
37 f
.docstring
= lambda docstring
=docstring
: docstring
40 resmethods
.append(genresconverter("Control", "Ctl"))
41 resmethods
.append(genresconverter("Menu", "Menu"))
43 # The definition of this one is MacLoadResource, so we do it by hand...
45 f
= ResMethod(void
, 'LoadResource',
46 (Handle
, 'theResource', InMode
),