Пример #1
0
static pascal DialogItemIndex MyAlert (UInt8 whichAlert, ConstStr255Param str1, ConstStr255Param str2)
{
	DialogItemIndex result = kDialogItemIndexNone;

	if (!AEInteractWithUser (kNoTimeOut,NULL,NULL))
	{
		ParamText (LMGetCurApName ( ), str1 ? str1 : "\p", str2 ? str2 : "\p", "\p");

		InitCursor ( );

		switch (whichAlert)
		{
			case kAlertIndex_ShortField :

				result = CautionAlert (kResID_Base + whichAlert, gStandardModalFilterUPP);
				break;

			default :

				result = StopAlert (kResID_Base + whichAlert, gStandardModalFilterUPP);
				break;
		}

		if (MoreAssertPCG (result != kDialogItemIndexNone))
		{
			EventRecord modifiers;
			OSEventAvail (0,&modifiers);
			if (modifiers.modifiers & optionKey)
				Debugger ( );
		}
	}
Пример #2
0
static PyObject *AE_AEInteractWithUser(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSErr _err;
	long timeOutInTicks;
#ifndef AEInteractWithUser
	PyMac_PRECHECK(AEInteractWithUser);
#endif
	if (!PyArg_ParseTuple(_args, "l",
	                      &timeOutInTicks))
		return NULL;
	_err = AEInteractWithUser(timeOutInTicks,
	                          (NMRecPtr)0,
	                          upp_AEIdleProc);
	if (_err != noErr) return PyMac_Error(_err);
	Py_INCREF(Py_None);
	_res = Py_None;
	return _res;
}