]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use ResObj_OptNew for GetDialogItem return value: the handle returned
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 17 Aug 1995 14:30:52 +0000 (14:30 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 17 Aug 1995 14:30:52 +0000 (14:30 +0000)
may be NULL (for user items, for instance).

Mac/Modules/dlg/dlgscan.py
Mac/Modules/dlg/dlgsupport.py

index 6738828606cd4ace93f256e941028fd376675c95..b56edfde8cc77e62cf103efd104e3c12bc1dc259 100644 (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")],
index 8761ea84c79fc4a4f00f8372dc2bcfd2dab17e49..0b5f08264f929791290eed4a89291de7ffc6d9ad 100644 (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