argument and return a Control or Menu object.
#include <Controls.h>
+#define as_Control(h) ((ControlHandle)h)
+
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
extern PyObject *CtlObj_WhichControl(ControlHandle); /* Forward */
return _res;
}
+static PyObject *Ctl_as_Control(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ ControlHandle _rv;
+ Handle h;
+ if (!PyArg_ParseTuple(_args, "O&",
+ ResObj_Convert, &h))
+ return NULL;
+ _rv = as_Control(h);
+ _res = Py_BuildValue("O&",
+ CtlObj_New, _rv);
+ return _res;
+}
+
static PyMethodDef Ctl_methods[] = {
{"NewControl", (PyCFunction)Ctl_NewControl, 1,
"(WindowPtr owningWindow, Rect boundsRect, Str255 controlTitle, Boolean initiallyVisible, SInt16 initialValue, SInt16 minimumValue, SInt16 maximumValue, SInt16 procID, SInt32 controlReference) -> (ControlHandle _rv)"},
"(WindowPtr inWindow) -> None"},
{"ClearKeyboardFocus", (PyCFunction)Ctl_ClearKeyboardFocus, 1,
"(WindowPtr inWindow) -> None"},
+ {"as_Control", (PyCFunction)Ctl_as_Control, 1,
+ "(Handle h) -> (ControlHandle _rv)"},
{NULL, NULL, 0}
};
+f = Function(ControlHandle, 'as_Control',
+ (Handle, 'h', InMode))
+functions.append(f)
+
as_resource_body = """
return ResObj_New((Handle)_self->ob_itself);
"""
includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """
+#define as_Control(h) ((ControlHandle)h)
+
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
extern PyObject *CtlObj_WhichControl(ControlHandle); /* Forward */
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
+#define as_Menu(h) ((MenuHandle)h)
+
static PyObject *Menu_Error;
/* ------------------------ Object type Menu ------------------------ */
return _res;
}
+static PyObject *Menu_as_Menu(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ MenuHandle _rv;
+ Handle h;
+ if (!PyArg_ParseTuple(_args, "O&",
+ ResObj_Convert, &h))
+ return NULL;
+ _rv = as_Menu(h);
+ _res = Py_BuildValue("O&",
+ MenuObj_New, _rv);
+ return _res;
+}
+
static PyObject *Menu_GetMenu(_self, _args)
PyObject *_self;
PyObject *_args;
"(EventRecord inEvent) -> (UInt32 _rv)"},
{"OpenDeskAcc", (PyCFunction)Menu_OpenDeskAcc, 1,
"(Str255 name) -> None"},
+ {"as_Menu", (PyCFunction)Menu_as_Menu, 1,
+ "(Handle h) -> (MenuHandle _rv)"},
{"GetMenu", (PyCFunction)Menu_GetMenu, 1,
"(short resourceID) -> (MenuHandle _rv)"},
{"DeleteMenu", (PyCFunction)Menu_DeleteMenu, 1,
)
functions.append(f)
+f = Function(MenuHandle, 'as_Menu',
+ (Handle, 'h', InMode))
+functions.append(f)
+
as_resource_body = """
return ResObj_New((Handle)_self->ob_itself);
"""
#include <%s>""" % MACHEADERFILE + """
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
+
+#define as_Menu(h) ((MenuHandle)h)
"""
class MyObjectDefinition(GlobalObjectDefinition):