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

Skip to content

Commit 54c0787

Browse files
committed
Added generators for EnableMenuItem and CheckMenuItem (which have Mac in front of their name in the include files).
1 parent f424f24 commit 54c0787

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

Mac/Modules/menu/Menumodule.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,41 @@ static PyObject *MenuObj_InsertMenuItem(_self, _args)
17421742
return _res;
17431743
}
17441744

1745+
static PyObject *MenuObj_EnableMenuItem(_self, _args)
1746+
MenuObject *_self;
1747+
PyObject *_args;
1748+
{
1749+
PyObject *_res = NULL;
1750+
UInt16 item;
1751+
if (!PyArg_ParseTuple(_args, "H",
1752+
&item))
1753+
return NULL;
1754+
EnableMenuItem(_self->ob_itself,
1755+
item);
1756+
Py_INCREF(Py_None);
1757+
_res = Py_None;
1758+
return _res;
1759+
}
1760+
1761+
static PyObject *MenuObj_CheckMenuItem(_self, _args)
1762+
MenuObject *_self;
1763+
PyObject *_args;
1764+
{
1765+
PyObject *_res = NULL;
1766+
short item;
1767+
Boolean checked;
1768+
if (!PyArg_ParseTuple(_args, "hb",
1769+
&item,
1770+
&checked))
1771+
return NULL;
1772+
CheckMenuItem(_self->ob_itself,
1773+
item,
1774+
checked);
1775+
Py_INCREF(Py_None);
1776+
_res = Py_None;
1777+
return _res;
1778+
}
1779+
17451780
static PyMethodDef MenuObj_methods[] = {
17461781
{"DisposeMenu", (PyCFunction)MenuObj_DisposeMenu, 1,
17471782
"() -> None"},
@@ -1990,6 +2025,10 @@ static PyMethodDef MenuObj_methods[] = {
19902025
"(short beforeID) -> None"},
19912026
{"InsertMenuItem", (PyCFunction)MenuObj_InsertMenuItem, 1,
19922027
"(Str255 itemString, short afterItem) -> None"},
2028+
{"EnableMenuItem", (PyCFunction)MenuObj_EnableMenuItem, 1,
2029+
"(UInt16 item) -> None"},
2030+
{"CheckMenuItem", (PyCFunction)MenuObj_CheckMenuItem, 1,
2031+
"(short item, Boolean checked) -> None"},
19932032
{NULL, NULL, 0}
19942033
};
19952034

Mac/Modules/menu/menuedit.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@
4141
)
4242
methods.append(f)
4343

44+
f = Method(void, 'EnableMenuItem',
45+
(MenuHandle, 'theMenu', InMode),
46+
(UInt16, 'item', InMode),
47+
)
48+
methods.append(f)
49+
50+
f = Method(void, 'CheckMenuItem',
51+
(MenuRef, 'theMenu', InMode),
52+
(short, 'item', InMode),
53+
(Boolean, 'checked', InMode),
54+
)
55+
methods.append(f)
56+
57+
4458
f = Function(void, 'DrawMenuBar',
4559
)
4660
functions.append(f)

0 commit comments

Comments
 (0)