示例#1
0
/*	DisposeXOPDialog(dialogID)

	This routine is implemented on Macintosh only.
	
	Thread Safety: DisposeXOPDialog is not thread-safe.
*/
void
DisposeXOPDialog(DialogPtr theDialog)
{
	DisposeDialog(theDialog);

	if (gXOPDialogFilterUPP != NULL) {
		DisposeModalFilterUPP(gXOPDialogFilterUPP);
		gXOPDialogFilterUPP = NULL;
	}
	
	SetDialogBalloonHelpID(-1);		// Tell Igor's contextual help that the dialog is finished.
}
示例#2
0
void ShowSecurityError(const char *format, ...) {
    va_list                 args;

#ifdef __x86_64__
    va_start(args, format);
    vfprintf(stderr, format, args);
    va_end(args);
#else
    char                    s[1024];
    short                   itemHit;
    AlertStdAlertParamRec   alertParams;
    ModalFilterUPP          ErrorDlgFilterProcUPP;
    
    ProcessSerialNumber	ourProcess;

    va_start(args, format);
    s[0] = vsprintf(s+1, format, args);
    va_end(args);

    ErrorDlgFilterProcUPP = NewModalFilterUPP(ErrorDlgFilterProc);

    alertParams.movable = true;
    alertParams.helpButton = false;
    alertParams.filterProc = ErrorDlgFilterProcUPP;
    alertParams.defaultText = "\pOK";
    alertParams.cancelText = NULL;
    alertParams.otherText = NULL;
    alertParams.defaultButton = kAlertStdAlertOKButton;
    alertParams.cancelButton = 0;
    alertParams.position = kWindowDefaultPosition;

    ::GetCurrentProcess (&ourProcess);
    ::SetFrontProcess(&ourProcess);

    StandardAlert (kAlertStopAlert, (StringPtr)s, NULL, &alertParams, &itemHit);

    DisposeModalFilterUPP(ErrorDlgFilterProcUPP);
#endif
}