summaryrefslogtreecommitdiffstats
path: root/Mac/Modules
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-01-29 13:32:10 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-01-29 13:32:10 (GMT)
commit54c07879094acde53a48f34a99ed904135bbf457 (patch)
treea1c560f1a812423aaa9f9f3a65541aff1c9a135e /Mac/Modules
parentf424f24bbb4231065f646d12d9d90c91f961d51a (diff)
downloadcpython-54c07879094acde53a48f34a99ed904135bbf457.zip
cpython-54c07879094acde53a48f34a99ed904135bbf457.tar.gz
cpython-54c07879094acde53a48f34a99ed904135bbf457.tar.bz2
Added generators for EnableMenuItem and CheckMenuItem (which have Mac in front of their name in the include files).
Diffstat (limited to 'Mac/Modules')
-rw-r--r--Mac/Modules/menu/Menumodule.c39
-rw-r--r--Mac/Modules/menu/menuedit.py14
2 files changed, 53 insertions, 0 deletions
diff --git a/Mac/Modules/menu/Menumodule.c b/Mac/Modules/menu/Menumodule.c
index 7f15330..782b270 100644
--- a/Mac/Modules/menu/Menumodule.c
+++ b/Mac/Modules/menu/Menumodule.c
@@ -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}
};
diff --git a/Mac/Modules/menu/menuedit.py b/Mac/Modules/menu/menuedit.py
index 5887193..4a9cf2a 100644
--- a/Mac/Modules/menu/menuedit.py
+++ b/Mac/Modules/menu/menuedit.py
@@ -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)