2 /* =========================== Module Dlg =========================== */
8 #define SystemSevenOrLater 1
16 extern PyObject
*ResObj_New(Handle
);
17 extern int ResObj_Convert(PyObject
*, Handle
*);
18 extern PyObject
*OptResObj_New(Handle
);
19 extern int OptResObj_Convert(PyObject
*, Handle
*);
21 extern PyObject
*WinObj_New(WindowPtr
);
22 extern int WinObj_Convert(PyObject
*, WindowPtr
*);
23 extern PyTypeObject Window_Type
;
24 #define WinObj_Check(x) ((x)->ob_type == &Window_Type)
26 extern PyObject
*DlgObj_New(DialogPtr
);
27 extern int DlgObj_Convert(PyObject
*, DialogPtr
*);
28 extern PyTypeObject Dialog_Type
;
29 #define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
31 extern PyObject
*MenuObj_New(MenuHandle
);
32 extern int MenuObj_Convert(PyObject
*, MenuHandle
*);
34 extern PyObject
*CtlObj_New(ControlHandle
);
35 extern int CtlObj_Convert(PyObject
*, ControlHandle
*);
37 extern PyObject
*GrafObj_New(GrafPtr
);
38 extern int GrafObj_Convert(PyObject
*, GrafPtr
*);
40 extern PyObject
*BMObj_New(BitMapPtr
);
41 extern int BMObj_Convert(PyObject
*, BitMapPtr
*);
43 extern PyObject
*WinObj_WhichWindow(WindowPtr
);
47 #ifndef HAVE_UNIVERSAL_HEADERS
48 #define NewModalFilterProc(x) (x)
51 #define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
53 /* XXX Shouldn't this be a stack? */
54 static PyObject
*Dlg_FilterProc_callback
= NULL
;
56 static PyObject
*DlgObj_New(DialogPtr
); /* Forward */
58 static pascal Boolean
Dlg_UnivFilterProc(DialogPtr dialog
,
64 PyObject
*callback
= Dlg_FilterProc_callback
;
66 return 0; /* Default behavior */
67 Dlg_FilterProc_callback
= NULL
; /* We'll restore it when call successful */
68 args
= Py_BuildValue("O&O&", WinObj_WhichWindow
, dialog
, PyMac_BuildEventRecord
, event
);
72 res
= PyEval_CallObject(callback
, args
);
76 fprintf(stderr
, "Exception in Dialog Filter\n");
78 *itemHit
= -1; /* Fake return item */
79 return 1; /* We handled it */
82 Dlg_FilterProc_callback
= callback
;
83 if (PyInt_Check(res
)) {
84 *itemHit
= PyInt_AsLong(res
);
88 rv
= PyObject_IsTrue(res
);
94 static ModalFilterProcPtr
95 Dlg_PassFilterProc(PyObject
*callback
)
97 PyObject
*tmp
= Dlg_FilterProc_callback
;
98 Dlg_FilterProc_callback
= NULL
;
99 if (callback
== Py_None
) {
104 Dlg_FilterProc_callback
= callback
;
106 return &Dlg_UnivFilterProc
;
109 extern PyMethodChain WinObj_chain
;
111 static PyObject
*Dlg_Error
;
113 /* ----------------------- Object type Dialog ----------------------- */
115 PyTypeObject Dialog_Type
;
117 #define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
119 typedef struct DialogObject
{
124 PyObject
*DlgObj_New(itself
)
128 if (itself
== NULL
) return Py_None
;
129 it
= PyObject_NEW(DialogObject
, &Dialog_Type
);
130 if (it
== NULL
) return NULL
;
131 it
->ob_itself
= itself
;
132 SetWRefCon(itself
, (long)it
);
133 return (PyObject
*)it
;
135 DlgObj_Convert(v
, p_itself
)
139 if (v
== Py_None
) { *p_itself
= NULL
; return 1; }
140 if (PyInt_Check(v
)) { *p_itself
= (DialogPtr
)PyInt_AsLong(v
);
142 if (!DlgObj_Check(v
))
144 PyErr_SetString(PyExc_TypeError
, "Dialog required");
147 *p_itself
= ((DialogObject
*)v
)->ob_itself
;
151 static void DlgObj_dealloc(self
)
154 DisposeDialog(self
->ob_itself
);
158 static PyObject
*DlgObj_DrawDialog(_self
, _args
)
162 PyObject
*_res
= NULL
;
163 if (!PyArg_ParseTuple(_args
, ""))
165 DrawDialog(_self
->ob_itself
);
171 static PyObject
*DlgObj_UpdateDialog(_self
, _args
)
175 PyObject
*_res
= NULL
;
177 if (!PyArg_ParseTuple(_args
, "O&",
178 ResObj_Convert
, &updateRgn
))
180 UpdateDialog(_self
->ob_itself
,
187 static PyObject
*DlgObj_HideDialogItem(_self
, _args
)
191 PyObject
*_res
= NULL
;
192 DialogItemIndex itemNo
;
193 if (!PyArg_ParseTuple(_args
, "h",
196 HideDialogItem(_self
->ob_itself
,
203 static PyObject
*DlgObj_ShowDialogItem(_self
, _args
)
207 PyObject
*_res
= NULL
;
208 DialogItemIndex itemNo
;
209 if (!PyArg_ParseTuple(_args
, "h",
212 ShowDialogItem(_self
->ob_itself
,
219 static PyObject
*DlgObj_FindDialogItem(_self
, _args
)
223 PyObject
*_res
= NULL
;
224 DialogItemIndexZeroBased _rv
;
226 if (!PyArg_ParseTuple(_args
, "O&",
227 PyMac_GetPoint
, &thePt
))
229 _rv
= FindDialogItem(_self
->ob_itself
,
231 _res
= Py_BuildValue("h",
236 static PyObject
*DlgObj_DialogCut(_self
, _args
)
240 PyObject
*_res
= NULL
;
241 if (!PyArg_ParseTuple(_args
, ""))
243 DialogCut(_self
->ob_itself
);
249 static PyObject
*DlgObj_DialogPaste(_self
, _args
)
253 PyObject
*_res
= NULL
;
254 if (!PyArg_ParseTuple(_args
, ""))
256 DialogPaste(_self
->ob_itself
);
262 static PyObject
*DlgObj_DialogCopy(_self
, _args
)
266 PyObject
*_res
= NULL
;
267 if (!PyArg_ParseTuple(_args
, ""))
269 DialogCopy(_self
->ob_itself
);
275 static PyObject
*DlgObj_DialogDelete(_self
, _args
)
279 PyObject
*_res
= NULL
;
280 if (!PyArg_ParseTuple(_args
, ""))
282 DialogDelete(_self
->ob_itself
);
288 static PyObject
*DlgObj_GetDialogItem(_self
, _args
)
292 PyObject
*_res
= NULL
;
293 DialogItemIndex itemNo
;
294 DialogItemType itemType
;
297 if (!PyArg_ParseTuple(_args
, "h",
300 GetDialogItem(_self
->ob_itself
,
305 _res
= Py_BuildValue("hO&O&",
308 PyMac_BuildRect
, &box
);
312 static PyObject
*DlgObj_SetDialogItem(_self
, _args
)
316 PyObject
*_res
= NULL
;
317 DialogItemIndex itemNo
;
318 DialogItemType itemType
;
321 if (!PyArg_ParseTuple(_args
, "hhO&O&",
324 ResObj_Convert
, &item
,
325 PyMac_GetRect
, &box
))
327 SetDialogItem(_self
->ob_itself
,
337 static PyObject
*DlgObj_SelectDialogItemText(_self
, _args
)
341 PyObject
*_res
= NULL
;
342 DialogItemIndex itemNo
;
345 if (!PyArg_ParseTuple(_args
, "hhh",
350 SelectDialogItemText(_self
->ob_itself
,
359 static PyObject
*DlgObj_AppendDITL(_self
, _args
)
363 PyObject
*_res
= NULL
;
366 if (!PyArg_ParseTuple(_args
, "O&h",
367 ResObj_Convert
, &theHandle
,
370 AppendDITL(_self
->ob_itself
,
378 static PyObject
*DlgObj_CountDITL(_self
, _args
)
382 PyObject
*_res
= NULL
;
384 if (!PyArg_ParseTuple(_args
, ""))
386 _rv
= CountDITL(_self
->ob_itself
);
387 _res
= Py_BuildValue("h",
392 static PyObject
*DlgObj_ShortenDITL(_self
, _args
)
396 PyObject
*_res
= NULL
;
397 DialogItemIndex numberItems
;
398 if (!PyArg_ParseTuple(_args
, "h",
401 ShortenDITL(_self
->ob_itself
,
408 static PyObject
*DlgObj_StdFilterProc(_self
, _args
)
412 PyObject
*_res
= NULL
;
415 DialogItemIndex itemHit
;
416 if (!PyArg_ParseTuple(_args
, ""))
418 _rv
= StdFilterProc(_self
->ob_itself
,
421 _res
= Py_BuildValue("bO&h",
423 PyMac_BuildEventRecord
, &event
,
428 static PyObject
*DlgObj_SetDialogDefaultItem(_self
, _args
)
432 PyObject
*_res
= NULL
;
434 DialogItemIndex newItem
;
435 if (!PyArg_ParseTuple(_args
, "h",
438 _err
= SetDialogDefaultItem(_self
->ob_itself
,
440 if (_err
!= noErr
) return PyMac_Error(_err
);
446 static PyObject
*DlgObj_SetDialogCancelItem(_self
, _args
)
450 PyObject
*_res
= NULL
;
452 DialogItemIndex newItem
;
453 if (!PyArg_ParseTuple(_args
, "h",
456 _err
= SetDialogCancelItem(_self
->ob_itself
,
458 if (_err
!= noErr
) return PyMac_Error(_err
);
464 static PyObject
*DlgObj_SetDialogTracksCursor(_self
, _args
)
468 PyObject
*_res
= NULL
;
471 if (!PyArg_ParseTuple(_args
, "b",
474 _err
= SetDialogTracksCursor(_self
->ob_itself
,
476 if (_err
!= noErr
) return PyMac_Error(_err
);
482 static PyObject
*DlgObj_AutoSizeDialog(_self
, _args
)
486 PyObject
*_res
= NULL
;
488 if (!PyArg_ParseTuple(_args
, ""))
490 _err
= AutoSizeDialog(_self
->ob_itself
);
491 if (_err
!= noErr
) return PyMac_Error(_err
);
497 static PyObject
*DlgObj_GetDialogItemAsControl(_self
, _args
)
501 PyObject
*_res
= NULL
;
504 ControlHandle outControl
;
505 if (!PyArg_ParseTuple(_args
, "h",
508 _err
= GetDialogItemAsControl(_self
->ob_itself
,
511 if (_err
!= noErr
) return PyMac_Error(_err
);
512 _res
= Py_BuildValue("O&",
513 CtlObj_New
, outControl
);
517 static PyObject
*DlgObj_MoveDialogItem(_self
, _args
)
521 PyObject
*_res
= NULL
;
526 if (!PyArg_ParseTuple(_args
, "hhh",
531 _err
= MoveDialogItem(_self
->ob_itself
,
535 if (_err
!= noErr
) return PyMac_Error(_err
);
541 static PyObject
*DlgObj_SizeDialogItem(_self
, _args
)
545 PyObject
*_res
= NULL
;
550 if (!PyArg_ParseTuple(_args
, "hhh",
555 _err
= SizeDialogItem(_self
->ob_itself
,
559 if (_err
!= noErr
) return PyMac_Error(_err
);
565 static PyObject
*DlgObj_GetDialogWindow(_self
, _args
)
569 PyObject
*_res
= NULL
;
571 if (!PyArg_ParseTuple(_args
, ""))
573 _rv
= GetDialogWindow(_self
->ob_itself
);
574 _res
= Py_BuildValue("O&",
575 WinObj_WhichWindow
, _rv
);
579 static PyObject
*DlgObj_GetDialogDefaultItem(_self
, _args
)
583 PyObject
*_res
= NULL
;
585 if (!PyArg_ParseTuple(_args
, ""))
587 _rv
= GetDialogDefaultItem(_self
->ob_itself
);
588 _res
= Py_BuildValue("h",
593 static PyObject
*DlgObj_GetDialogCancelItem(_self
, _args
)
597 PyObject
*_res
= NULL
;
599 if (!PyArg_ParseTuple(_args
, ""))
601 _rv
= GetDialogCancelItem(_self
->ob_itself
);
602 _res
= Py_BuildValue("h",
607 static PyObject
*DlgObj_GetDialogKeyboardFocusItem(_self
, _args
)
611 PyObject
*_res
= NULL
;
613 if (!PyArg_ParseTuple(_args
, ""))
615 _rv
= GetDialogKeyboardFocusItem(_self
->ob_itself
);
616 _res
= Py_BuildValue("h",
621 static PyObject
*DlgObj_SetGrafPortOfDialog(_self
, _args
)
625 PyObject
*_res
= NULL
;
626 if (!PyArg_ParseTuple(_args
, ""))
628 SetGrafPortOfDialog(_self
->ob_itself
);
634 static PyMethodDef DlgObj_methods
[] = {
635 {"DrawDialog", (PyCFunction
)DlgObj_DrawDialog
, 1,
637 {"UpdateDialog", (PyCFunction
)DlgObj_UpdateDialog
, 1,
638 "(RgnHandle updateRgn) -> None"},
639 {"HideDialogItem", (PyCFunction
)DlgObj_HideDialogItem
, 1,
640 "(DialogItemIndex itemNo) -> None"},
641 {"ShowDialogItem", (PyCFunction
)DlgObj_ShowDialogItem
, 1,
642 "(DialogItemIndex itemNo) -> None"},
643 {"FindDialogItem", (PyCFunction
)DlgObj_FindDialogItem
, 1,
644 "(Point thePt) -> (DialogItemIndexZeroBased _rv)"},
645 {"DialogCut", (PyCFunction
)DlgObj_DialogCut
, 1,
647 {"DialogPaste", (PyCFunction
)DlgObj_DialogPaste
, 1,
649 {"DialogCopy", (PyCFunction
)DlgObj_DialogCopy
, 1,
651 {"DialogDelete", (PyCFunction
)DlgObj_DialogDelete
, 1,
653 {"GetDialogItem", (PyCFunction
)DlgObj_GetDialogItem
, 1,
654 "(DialogItemIndex itemNo) -> (DialogItemType itemType, Handle item, Rect box)"},
655 {"SetDialogItem", (PyCFunction
)DlgObj_SetDialogItem
, 1,
656 "(DialogItemIndex itemNo, DialogItemType itemType, Handle item, Rect box) -> None"},
657 {"SelectDialogItemText", (PyCFunction
)DlgObj_SelectDialogItemText
, 1,
658 "(DialogItemIndex itemNo, SInt16 strtSel, SInt16 endSel) -> None"},
659 {"AppendDITL", (PyCFunction
)DlgObj_AppendDITL
, 1,
660 "(Handle theHandle, DITLMethod method) -> None"},
661 {"CountDITL", (PyCFunction
)DlgObj_CountDITL
, 1,
662 "() -> (DialogItemIndex _rv)"},
663 {"ShortenDITL", (PyCFunction
)DlgObj_ShortenDITL
, 1,
664 "(DialogItemIndex numberItems) -> None"},
665 {"StdFilterProc", (PyCFunction
)DlgObj_StdFilterProc
, 1,
666 "() -> (Boolean _rv, EventRecord event, DialogItemIndex itemHit)"},
667 {"SetDialogDefaultItem", (PyCFunction
)DlgObj_SetDialogDefaultItem
, 1,
668 "(DialogItemIndex newItem) -> None"},
669 {"SetDialogCancelItem", (PyCFunction
)DlgObj_SetDialogCancelItem
, 1,
670 "(DialogItemIndex newItem) -> None"},
671 {"SetDialogTracksCursor", (PyCFunction
)DlgObj_SetDialogTracksCursor
, 1,
672 "(Boolean tracks) -> None"},
673 {"AutoSizeDialog", (PyCFunction
)DlgObj_AutoSizeDialog
, 1,
675 {"GetDialogItemAsControl", (PyCFunction
)DlgObj_GetDialogItemAsControl
, 1,
676 "(SInt16 inItemNo) -> (ControlHandle outControl)"},
677 {"MoveDialogItem", (PyCFunction
)DlgObj_MoveDialogItem
, 1,
678 "(SInt16 inItemNo, SInt16 inHoriz, SInt16 inVert) -> None"},
679 {"SizeDialogItem", (PyCFunction
)DlgObj_SizeDialogItem
, 1,
680 "(SInt16 inItemNo, SInt16 inHeight, SInt16 inWidth) -> None"},
681 {"GetDialogWindow", (PyCFunction
)DlgObj_GetDialogWindow
, 1,
682 "() -> (DialogPtr _rv)"},
683 {"GetDialogDefaultItem", (PyCFunction
)DlgObj_GetDialogDefaultItem
, 1,
684 "() -> (SInt16 _rv)"},
685 {"GetDialogCancelItem", (PyCFunction
)DlgObj_GetDialogCancelItem
, 1,
686 "() -> (SInt16 _rv)"},
687 {"GetDialogKeyboardFocusItem", (PyCFunction
)DlgObj_GetDialogKeyboardFocusItem
, 1,
688 "() -> (SInt16 _rv)"},
689 {"SetGrafPortOfDialog", (PyCFunction
)DlgObj_SetGrafPortOfDialog
, 1,
694 PyMethodChain DlgObj_chain
= { DlgObj_methods
, &WinObj_chain
};
696 static PyObject
*DlgObj_getattr(self
, name
)
700 return Py_FindMethodInChain(&DlgObj_chain
, (PyObject
*)self
, name
);
703 #define DlgObj_setattr NULL
705 PyTypeObject Dialog_Type
= {
706 PyObject_HEAD_INIT(&PyType_Type
)
708 "Dialog", /*tp_name*/
709 sizeof(DialogObject
), /*tp_basicsize*/
712 (destructor
) DlgObj_dealloc
, /*tp_dealloc*/
714 (getattrfunc
) DlgObj_getattr
, /*tp_getattr*/
715 (setattrfunc
) DlgObj_setattr
, /*tp_setattr*/
718 /* --------------------- End object type Dialog --------------------- */
721 static PyObject
*Dlg_NewDialog(_self
, _args
)
725 PyObject
*_res
= NULL
;
735 if (!PyArg_ParseTuple(_args
, "O&O&bhO&blO&",
736 PyMac_GetRect
, &boundsRect
,
737 PyMac_GetStr255
, title
,
740 WinObj_Convert
, &behind
,
743 ResObj_Convert
, &items
))
745 _rv
= NewDialog((void *)0,
754 _res
= Py_BuildValue("O&",
759 static PyObject
*Dlg_GetNewDialog(_self
, _args
)
763 PyObject
*_res
= NULL
;
767 if (!PyArg_ParseTuple(_args
, "hO&",
769 WinObj_Convert
, &behind
))
771 _rv
= GetNewDialog(dialogID
,
774 _res
= Py_BuildValue("O&",
779 static PyObject
*Dlg_NewColorDialog(_self
, _args
)
783 PyObject
*_res
= NULL
;
793 if (!PyArg_ParseTuple(_args
, "O&O&bhO&blO&",
794 PyMac_GetRect
, &boundsRect
,
795 PyMac_GetStr255
, title
,
798 WinObj_Convert
, &behind
,
801 ResObj_Convert
, &items
))
803 _rv
= NewColorDialog((void *)0,
812 _res
= Py_BuildValue("O&",
817 static PyObject
*Dlg_ModalDialog(_self
, _args
)
821 PyObject
*_res
= NULL
;
822 PyObject
* modalFilter
;
823 DialogItemIndex itemHit
;
824 if (!PyArg_ParseTuple(_args
, "O",
827 ModalDialog(NewModalFilterProc(Dlg_PassFilterProc(modalFilter
)),
829 _res
= Py_BuildValue("h",
834 static PyObject
*Dlg_IsDialogEvent(_self
, _args
)
838 PyObject
*_res
= NULL
;
840 EventRecord theEvent
;
841 if (!PyArg_ParseTuple(_args
, "O&",
842 PyMac_GetEventRecord
, &theEvent
))
844 _rv
= IsDialogEvent(&theEvent
);
845 _res
= Py_BuildValue("b",
850 static PyObject
*Dlg_DialogSelect(_self
, _args
)
854 PyObject
*_res
= NULL
;
856 EventRecord theEvent
;
858 DialogItemIndex itemHit
;
859 if (!PyArg_ParseTuple(_args
, "O&",
860 PyMac_GetEventRecord
, &theEvent
))
862 _rv
= DialogSelect(&theEvent
,
865 _res
= Py_BuildValue("bO&h",
867 WinObj_WhichWindow
, theDialog
,
872 static PyObject
*Dlg_Alert(_self
, _args
)
876 PyObject
*_res
= NULL
;
879 PyObject
* modalFilter
;
880 if (!PyArg_ParseTuple(_args
, "hO",
885 NewModalFilterProc(Dlg_PassFilterProc(modalFilter
)));
886 _res
= Py_BuildValue("h",
891 static PyObject
*Dlg_StopAlert(_self
, _args
)
895 PyObject
*_res
= NULL
;
898 PyObject
* modalFilter
;
899 if (!PyArg_ParseTuple(_args
, "hO",
903 _rv
= StopAlert(alertID
,
904 NewModalFilterProc(Dlg_PassFilterProc(modalFilter
)));
905 _res
= Py_BuildValue("h",
910 static PyObject
*Dlg_NoteAlert(_self
, _args
)
914 PyObject
*_res
= NULL
;
917 PyObject
* modalFilter
;
918 if (!PyArg_ParseTuple(_args
, "hO",
922 _rv
= NoteAlert(alertID
,
923 NewModalFilterProc(Dlg_PassFilterProc(modalFilter
)));
924 _res
= Py_BuildValue("h",
929 static PyObject
*Dlg_CautionAlert(_self
, _args
)
933 PyObject
*_res
= NULL
;
936 PyObject
* modalFilter
;
937 if (!PyArg_ParseTuple(_args
, "hO",
941 _rv
= CautionAlert(alertID
,
942 NewModalFilterProc(Dlg_PassFilterProc(modalFilter
)));
943 _res
= Py_BuildValue("h",
948 static PyObject
*Dlg_ParamText(_self
, _args
)
952 PyObject
*_res
= NULL
;
957 if (!PyArg_ParseTuple(_args
, "O&O&O&O&",
958 PyMac_GetStr255
, param0
,
959 PyMac_GetStr255
, param1
,
960 PyMac_GetStr255
, param2
,
961 PyMac_GetStr255
, param3
))
972 static PyObject
*Dlg_GetDialogItemText(_self
, _args
)
976 PyObject
*_res
= NULL
;
979 if (!PyArg_ParseTuple(_args
, "O&",
980 ResObj_Convert
, &item
))
982 GetDialogItemText(item
,
984 _res
= Py_BuildValue("O&",
985 PyMac_BuildStr255
, text
);
989 static PyObject
*Dlg_SetDialogItemText(_self
, _args
)
993 PyObject
*_res
= NULL
;
996 if (!PyArg_ParseTuple(_args
, "O&O&",
997 ResObj_Convert
, &item
,
998 PyMac_GetStr255
, text
))
1000 SetDialogItemText(item
,
1007 static PyObject
*Dlg_GetAlertStage(_self
, _args
)
1011 PyObject
*_res
= NULL
;
1013 if (!PyArg_ParseTuple(_args
, ""))
1015 _rv
= GetAlertStage();
1016 _res
= Py_BuildValue("h",
1021 static PyObject
*Dlg_SetDialogFont(_self
, _args
)
1025 PyObject
*_res
= NULL
;
1027 if (!PyArg_ParseTuple(_args
, "h",
1030 SetDialogFont(value
);
1036 static PyObject
*Dlg_ResetAlertStage(_self
, _args
)
1040 PyObject
*_res
= NULL
;
1041 if (!PyArg_ParseTuple(_args
, ""))
1049 static PyObject
*Dlg_NewFeaturesDialog(_self
, _args
)
1053 PyObject
*_res
= NULL
;
1057 Boolean inIsVisible
;
1060 Boolean inGoAwayFlag
;
1062 Handle inItemListHandle
;
1064 if (!PyArg_ParseTuple(_args
, "O&O&bhO&blO&l",
1065 PyMac_GetRect
, &inBoundsRect
,
1066 PyMac_GetStr255
, inTitle
,
1069 WinObj_Convert
, &inBehind
,
1072 ResObj_Convert
, &inItemListHandle
,
1075 _rv
= NewFeaturesDialog((void *)0,
1085 _res
= Py_BuildValue("O&",
1090 static PyMethodDef Dlg_methods
[] = {
1091 {"NewDialog", (PyCFunction
)Dlg_NewDialog
, 1,
1092 "(Rect boundsRect, Str255 title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle items) -> (DialogPtr _rv)"},
1093 {"GetNewDialog", (PyCFunction
)Dlg_GetNewDialog
, 1,
1094 "(SInt16 dialogID, WindowPtr behind) -> (DialogPtr _rv)"},
1095 {"NewColorDialog", (PyCFunction
)Dlg_NewColorDialog
, 1,
1096 "(Rect boundsRect, Str255 title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle items) -> (DialogPtr _rv)"},
1097 {"ModalDialog", (PyCFunction
)Dlg_ModalDialog
, 1,
1098 "(PyObject* modalFilter) -> (DialogItemIndex itemHit)"},
1099 {"IsDialogEvent", (PyCFunction
)Dlg_IsDialogEvent
, 1,
1100 "(EventRecord theEvent) -> (Boolean _rv)"},
1101 {"DialogSelect", (PyCFunction
)Dlg_DialogSelect
, 1,
1102 "(EventRecord theEvent) -> (Boolean _rv, DialogPtr theDialog, DialogItemIndex itemHit)"},
1103 {"Alert", (PyCFunction
)Dlg_Alert
, 1,
1104 "(SInt16 alertID, PyObject* modalFilter) -> (DialogItemIndex _rv)"},
1105 {"StopAlert", (PyCFunction
)Dlg_StopAlert
, 1,
1106 "(SInt16 alertID, PyObject* modalFilter) -> (DialogItemIndex _rv)"},
1107 {"NoteAlert", (PyCFunction
)Dlg_NoteAlert
, 1,
1108 "(SInt16 alertID, PyObject* modalFilter) -> (DialogItemIndex _rv)"},
1109 {"CautionAlert", (PyCFunction
)Dlg_CautionAlert
, 1,
1110 "(SInt16 alertID, PyObject* modalFilter) -> (DialogItemIndex _rv)"},
1111 {"ParamText", (PyCFunction
)Dlg_ParamText
, 1,
1112 "(Str255 param0, Str255 param1, Str255 param2, Str255 param3) -> None"},
1113 {"GetDialogItemText", (PyCFunction
)Dlg_GetDialogItemText
, 1,
1114 "(Handle item) -> (Str255 text)"},
1115 {"SetDialogItemText", (PyCFunction
)Dlg_SetDialogItemText
, 1,
1116 "(Handle item, Str255 text) -> None"},
1117 {"GetAlertStage", (PyCFunction
)Dlg_GetAlertStage
, 1,
1118 "() -> (SInt16 _rv)"},
1119 {"SetDialogFont", (PyCFunction
)Dlg_SetDialogFont
, 1,
1120 "(SInt16 value) -> None"},
1121 {"ResetAlertStage", (PyCFunction
)Dlg_ResetAlertStage
, 1,
1123 {"NewFeaturesDialog", (PyCFunction
)Dlg_NewFeaturesDialog
, 1,
1124 "(Rect inBoundsRect, Str255 inTitle, Boolean inIsVisible, SInt16 inProcID, WindowPtr inBehind, Boolean inGoAwayFlag, SInt32 inRefCon, Handle inItemListHandle, UInt32 inFlags) -> (DialogPtr _rv)"},
1139 m
= Py_InitModule("Dlg", Dlg_methods
);
1140 d
= PyModule_GetDict(m
);
1141 Dlg_Error
= PyMac_GetOSErrException();
1142 if (Dlg_Error
== NULL
||
1143 PyDict_SetItemString(d
, "Error", Dlg_Error
) != 0)
1144 Py_FatalError("can't initialize Dlg.Error");
1145 Dialog_Type
.ob_type
= &PyType_Type
;
1146 Py_INCREF(&Dialog_Type
);
1147 if (PyDict_SetItemString(d
, "DialogType", (PyObject
*)&Dialog_Type
) != 0)
1148 Py_FatalError("can't initialize DialogType");
1151 /* ========================= End module Dlg ========================= */