Use ResObj_OptNew for GetDialogItem return value: the handle returned

may be NULL (for user items, for instance).
This commit is contained in:
Jack Jansen 1995-08-17 14:30:52 +00:00
parent 9f37c6d91c
commit 91a6398b17
2 changed files with 10 additions and 0 deletions

View File

@ -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")],

View File

@ -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