summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/dlg/dlgsupport.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Modules/dlg/dlgsupport.py')
-rw-r--r--Mac/Modules/dlg/dlgsupport.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Mac/Modules/dlg/dlgsupport.py b/Mac/Modules/dlg/dlgsupport.py
index 85e72bb..1eb5576 100644
--- a/Mac/Modules/dlg/dlgsupport.py
+++ b/Mac/Modules/dlg/dlgsupport.py
@@ -10,7 +10,7 @@ from macsupport import *
DialogPtr = OpaqueByValueType("DialogPtr", "DlgObj")
ModalFilterProcPtr = InputOnlyType("PyObject*", "O")
-ModalFilterProcPtr.passInput = lambda name: "Dlg_PassFilterProc(%s)" % name
+ModalFilterProcPtr.passInput = lambda name: "NewModalFilterProc(Dlg_PassFilterProc(%s))" % name
RgnHandle = FakeType("_self->ob_itself->visRgn") # XXX
@@ -19,6 +19,10 @@ DITLMethod = Type("DITLMethod", "h")
includestuff = includestuff + """
#include <Dialogs.h>
+#ifndef HAVE_UNIVERSAL_HEADERS
+#define NewModalFilterProc(x) (x)
+#endif
+
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
/* XXX Shouldn't this be a stack? */
@@ -36,7 +40,7 @@ static pascal Boolean Dlg_UnivFilterProc(DialogPtr dialog,
if (callback == NULL)
return 0; /* Default behavior */
Dlg_FilterProc_callback = NULL; /* We'll restore it when call successful */
- args = Py_BuildValue("O&s#", DlgObj_New, dialog, event, sizeof(EventRecord));
+ args = Py_BuildValue("O&s#", DlgObj_New, dialog, event, (int)sizeof(EventRecord));
if (args == NULL)
res = NULL;
else {