summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-08-17 14:30:52 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-08-17 14:30:52 (GMT)
commit91a6398b175f8eda53866ccd3dfdcfd2046e8644 (patch)
tree666fdcf9944769ca3fb377b7f69d60113311a589 /Mac
parent9f37c6d91c1134bd44ee74e2ac77d5e1435f4e71 (diff)
downloadcpython-91a6398b175f8eda53866ccd3dfdcfd2046e8644.zip
cpython-91a6398b175f8eda53866ccd3dfdcfd2046e8644.tar.gz
cpython-91a6398b175f8eda53866ccd3dfdcfd2046e8644.tar.bz2
Use ResObj_OptNew for GetDialogItem return value: the handle returned
may be NULL (for user items, for instance).
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Modules/dlg/dlgscan.py4
-rw-r--r--Mac/Modules/dlg/dlgsupport.py6
2 files changed, 10 insertions, 0 deletions
diff --git a/Mac/Modules/dlg/dlgscan.py b/Mac/Modules/dlg/dlgscan.py
index 6738828..b56edfd 100644
--- a/Mac/Modules/dlg/dlgscan.py
+++ b/Mac/Modules/dlg/dlgscan.py
@@ -63,6 +63,10 @@ class MyScanner(Scanner):
([("void", "*", "OutMode"), ("long", "*", "InMode"),
("long", "*", "OutMode")],
[("VarVarOutBuffer", "*", "InOutMode")]),
+
+ # GetDialogItem return handle is optional
+ ([("Handle", "item", "OutMode")],
+ [("OptHandle", "item", "OutMode")]),
# NewDialog ETC.
([("void", "*", "OutMode")],
diff --git a/Mac/Modules/dlg/dlgsupport.py b/Mac/Modules/dlg/dlgsupport.py
index 8761ea8..0b5f082 100644
--- a/Mac/Modules/dlg/dlgsupport.py
+++ b/Mac/Modules/dlg/dlgsupport.py
@@ -13,6 +13,12 @@ from macsupport import *
DialogPtr = OpaqueByValueType("DialogPtr", "DlgObj")
DialogRef = DialogPtr
+# XXXX There must be a more elegant way to do this. An OptHandle is
+# either a handle or None (in case NULL is passed in). This is needed
+# for GetDialogItem().
+OptHandle = OpaqueByValueType("Handle", "ResObj")
+OptHandle.new = "ResObj_OptNew"
+
ModalFilterProcPtr = InputOnlyType("PyObject*", "O")
ModalFilterProcPtr.passInput = lambda name: "NewModalFilterProc(Dlg_PassFilterProc(%s))" % name
ModalFilterUPP = ModalFilterProcPtr