]> granicus.if.org Git - python/commitdiff
StdFilterProc() uses InOut parameters.
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 27 Feb 2003 22:50:50 +0000 (22:50 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 27 Feb 2003 22:50:50 +0000 (22:50 +0000)
Mac/Modules/dlg/_Dlgmodule.c
Mac/Modules/dlg/dlgscan.py

index c4e3ed881957ad37e686e13c4a4d4b625e42c869..3e0bc6df7c7b52b6aeb6755e58c9a7b4fdd374fc 100644 (file)
@@ -14,9 +14,9 @@
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
-       PyErr_SetString(PyExc_NotImplementedError, \
-       "Not available in this shared library/OS version"); \
-       return NULL; \
+        PyErr_SetString(PyExc_NotImplementedError, \
+        "Not available in this shared library/OS version"); \
+        return NULL; \
     }} while(0)
 
 
@@ -502,7 +502,9 @@ static PyObject *DlgObj_StdFilterProc(DialogObject *_self, PyObject *_args)
 #ifndef StdFilterProc
        PyMac_PRECHECK(StdFilterProc);
 #endif
-       if (!PyArg_ParseTuple(_args, ""))
+       if (!PyArg_ParseTuple(_args, "O&h",
+                             PyMac_GetEventRecord, &event,
+                             &itemHit))
                return NULL;
        _rv = StdFilterProc(_self->ob_itself,
                            &event,
@@ -903,7 +905,7 @@ static PyMethodDef DlgObj_methods[] = {
        {"RemoveDialogItems", (PyCFunction)DlgObj_RemoveDialogItems, 1,
         PyDoc_STR("(DialogItemIndex itemNo, DialogItemIndex amountToRemove, Boolean disposeItemData) -> None")},
        {"StdFilterProc", (PyCFunction)DlgObj_StdFilterProc, 1,
-        PyDoc_STR("() -> (Boolean _rv, EventRecord event, DialogItemIndex itemHit)")},
+        PyDoc_STR("(EventRecord event, DialogItemIndex itemHit) -> (Boolean _rv, EventRecord event, DialogItemIndex itemHit)")},
        {"SetDialogDefaultItem", (PyCFunction)DlgObj_SetDialogDefaultItem, 1,
         PyDoc_STR("(DialogItemIndex newItem) -> None")},
        {"SetDialogCancelItem", (PyCFunction)DlgObj_SetDialogCancelItem, 1,
index 9567419359998b331371fe387f9fa706fd719922..3710d5d00091adef6b60688f5229cb3ac99373d2 100644 (file)
@@ -99,6 +99,13 @@ class MyScanner(Scanner):
                         [("ExistingWindowPtr", "*", "*")]),
                        ([("WindowPtr", "*", "ReturnMode")],
                         [("ExistingWindowPtr", "*", "*")]),
+                        
+                       # StdFilterProc
+                       ([('EventRecord', 'event', 'OutMode'), 
+                         ('DialogItemIndex', 'itemHit', 'OutMode')],
+                        [('EventRecord', 'event', 'InOutMode'), 
+                         ('DialogItemIndex', 'itemHit', 'InOutMode')])
+
                        ]
 
        def writeinitialdefs(self):