summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/dlg
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-09-23 15:48:46 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-09-23 15:48:46 (GMT)
commitd96cb5088a41d218bfa6e4db444fc4b671c00c9b (patch)
tree186b1c1ede29a3992e71180f094c10774cd03f1d /Mac/Modules/dlg
parent0d1069e42fe5ec73954a48c910e0e89ce663f829 (diff)
downloadcpython-d96cb5088a41d218bfa6e4db444fc4b671c00c9b.zip
cpython-d96cb5088a41d218bfa6e4db444fc4b671c00c9b.tar.gz
cpython-d96cb5088a41d218bfa6e4db444fc4b671c00c9b.tar.bz2
Added support for GetDialogWindow and other accessor functions
Diffstat (limited to 'Mac/Modules/dlg')
-rw-r--r--Mac/Modules/dlg/Dlgmodule.c79
-rw-r--r--Mac/Modules/dlg/dlgsupport.py14
2 files changed, 93 insertions, 0 deletions
diff --git a/Mac/Modules/dlg/Dlgmodule.c b/Mac/Modules/dlg/Dlgmodule.c
index c0297f3..5949ea1 100644
--- a/Mac/Modules/dlg/Dlgmodule.c
+++ b/Mac/Modules/dlg/Dlgmodule.c
@@ -479,6 +479,75 @@ static PyObject *DlgObj_SetDialogTracksCursor(_self, _args)
return _res;
}
+static PyObject *DlgObj_GetDialogWindow(_self, _args)
+ DialogObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ DialogPtr _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = GetDialogWindow(_self->ob_itself);
+ _res = Py_BuildValue("O&",
+ WinObj_WhichWindow, _rv);
+ return _res;
+}
+
+static PyObject *DlgObj_GetDialogDefaultItem(_self, _args)
+ DialogObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ SInt16 _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = GetDialogDefaultItem(_self->ob_itself);
+ _res = Py_BuildValue("h",
+ _rv);
+ return _res;
+}
+
+static PyObject *DlgObj_GetDialogCancelItem(_self, _args)
+ DialogObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ SInt16 _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = GetDialogCancelItem(_self->ob_itself);
+ _res = Py_BuildValue("h",
+ _rv);
+ return _res;
+}
+
+static PyObject *DlgObj_GetDialogKeyboardFocusItem(_self, _args)
+ DialogObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ SInt16 _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = GetDialogKeyboardFocusItem(_self->ob_itself);
+ _res = Py_BuildValue("h",
+ _rv);
+ return _res;
+}
+
+static PyObject *DlgObj_SetGrafPortOfDialog(_self, _args)
+ DialogObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ SetGrafPortOfDialog(_self->ob_itself);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
static PyMethodDef DlgObj_methods[] = {
{"DrawDialog", (PyCFunction)DlgObj_DrawDialog, 1,
"() -> None"},
@@ -518,6 +587,16 @@ static PyMethodDef DlgObj_methods[] = {
"(short newItem) -> None"},
{"SetDialogTracksCursor", (PyCFunction)DlgObj_SetDialogTracksCursor, 1,
"(Boolean tracks) -> None"},
+ {"GetDialogWindow", (PyCFunction)DlgObj_GetDialogWindow, 1,
+ "() -> (DialogPtr _rv)"},
+ {"GetDialogDefaultItem", (PyCFunction)DlgObj_GetDialogDefaultItem, 1,
+ "() -> (SInt16 _rv)"},
+ {"GetDialogCancelItem", (PyCFunction)DlgObj_GetDialogCancelItem, 1,
+ "() -> (SInt16 _rv)"},
+ {"GetDialogKeyboardFocusItem", (PyCFunction)DlgObj_GetDialogKeyboardFocusItem, 1,
+ "() -> (SInt16 _rv)"},
+ {"SetGrafPortOfDialog", (PyCFunction)DlgObj_SetGrafPortOfDialog, 1,
+ "() -> None"},
{NULL, NULL, 0}
};
diff --git a/Mac/Modules/dlg/dlgsupport.py b/Mac/Modules/dlg/dlgsupport.py
index ca4e0df..14bef36 100644
--- a/Mac/Modules/dlg/dlgsupport.py
+++ b/Mac/Modules/dlg/dlgsupport.py
@@ -129,6 +129,20 @@ execfile("dlggen.py")
for f in functions: module.add(f)
for f in methods: object.add(f)
+# Some methods that are currently macro's in C, but will be real routines
+# in MacOS 8.
+
+f = Method(ExistingDialogPtr, 'GetDialogWindow', (DialogRef, 'dialog', InMode))
+object.add(f)
+f = Method(SInt16, 'GetDialogDefaultItem', (DialogRef, 'dialog', InMode))
+object.add(f)
+f = Method(SInt16, 'GetDialogCancelItem', (DialogRef, 'dialog', InMode))
+object.add(f)
+f = Method(SInt16, 'GetDialogKeyboardFocusItem', (DialogRef, 'dialog', InMode))
+object.add(f)
+f = Method(void, 'SetGrafPortOfDialog', (DialogRef, 'dialog', InMode))
+object.add(f)
+
# generate output
SetOutputFileName('Dlgmodule.c')
module.generate()