mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Added generators for EnableMenuItem and CheckMenuItem (which have Mac in front of their name in the include files).
This commit is contained in:
parent
f424f24bbb
commit
54c0787909
2 changed files with 53 additions and 0 deletions
|
|
@ -1742,6 +1742,41 @@ static PyObject *MenuObj_InsertMenuItem(_self, _args)
|
|||
return _res;
|
||||
}
|
||||
|
||||
static PyObject *MenuObj_EnableMenuItem(_self, _args)
|
||||
MenuObject *_self;
|
||||
PyObject *_args;
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
UInt16 item;
|
||||
if (!PyArg_ParseTuple(_args, "H",
|
||||
&item))
|
||||
return NULL;
|
||||
EnableMenuItem(_self->ob_itself,
|
||||
item);
|
||||
Py_INCREF(Py_None);
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
|
||||
static PyObject *MenuObj_CheckMenuItem(_self, _args)
|
||||
MenuObject *_self;
|
||||
PyObject *_args;
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
short item;
|
||||
Boolean checked;
|
||||
if (!PyArg_ParseTuple(_args, "hb",
|
||||
&item,
|
||||
&checked))
|
||||
return NULL;
|
||||
CheckMenuItem(_self->ob_itself,
|
||||
item,
|
||||
checked);
|
||||
Py_INCREF(Py_None);
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
|
||||
static PyMethodDef MenuObj_methods[] = {
|
||||
{"DisposeMenu", (PyCFunction)MenuObj_DisposeMenu, 1,
|
||||
"() -> None"},
|
||||
|
|
@ -1990,6 +2025,10 @@ static PyMethodDef MenuObj_methods[] = {
|
|||
"(short beforeID) -> None"},
|
||||
{"InsertMenuItem", (PyCFunction)MenuObj_InsertMenuItem, 1,
|
||||
"(Str255 itemString, short afterItem) -> None"},
|
||||
{"EnableMenuItem", (PyCFunction)MenuObj_EnableMenuItem, 1,
|
||||
"(UInt16 item) -> None"},
|
||||
{"CheckMenuItem", (PyCFunction)MenuObj_CheckMenuItem, 1,
|
||||
"(short item, Boolean checked) -> None"},
|
||||
{NULL, NULL, 0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,20 @@ f = Method(void, 'InsertMenuItem',
|
|||
)
|
||||
methods.append(f)
|
||||
|
||||
f = Method(void, 'EnableMenuItem',
|
||||
(MenuHandle, 'theMenu', InMode),
|
||||
(UInt16, 'item', InMode),
|
||||
)
|
||||
methods.append(f)
|
||||
|
||||
f = Method(void, 'CheckMenuItem',
|
||||
(MenuRef, 'theMenu', InMode),
|
||||
(short, 'item', InMode),
|
||||
(Boolean, 'checked', InMode),
|
||||
)
|
||||
methods.append(f)
|
||||
|
||||
|
||||
f = Function(void, 'DrawMenuBar',
|
||||
)
|
||||
functions.append(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue