mirror of https://github.com/python/cpython
Use ResObj_OptNew for GetDialogItem return value: the handle returned
may be NULL (for user items, for instance).
This commit is contained in:
parent
9f37c6d91c
commit
91a6398b17
|
@ -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")],
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue