diff --git a/Mac/Modules/dlg/dlgscan.py b/Mac/Modules/dlg/dlgscan.py index 6738828606c..b56edfde8cc 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 8761ea84c79..0b5f08264f9 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