From b8d2f6d034fc130db717926456dec676e86c11e2 Mon Sep 17 00:00:00 2001 From: Miro Jurisic Date: Tue, 14 Jul 1998 15:14:45 +0000 Subject: Mac: now calling NewCWindow when possible; changed GetNextEvent to WaitNextEvent git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10635 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/et/com_err.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/util/et/com_err.c b/src/util/et/com_err.c index 37e3d987c..7ae2a23c7 100644 --- a/src/util/et/com_err.c +++ b/src/util/et/com_err.c @@ -163,6 +163,8 @@ static void MacMessageBox(errbuf) EventRecord theEvent; Point localPt; Boolean done; + long gestaltResult; + OSErr theError; /* Find Centered rect for window */ tmpRect.top = ((mainRect.bottom + mainRect.top)/2 - @@ -173,8 +175,13 @@ static void MacMessageBox(errbuf) tmpRect.right = tmpRect.left + (errRect.right - errRect.left); /* Create the error window - as a dialog window */ - errWindow = NewWindow(NULL, &tmpRect, "\p", TRUE, - dBoxProc, (WindowPtr) -1, FALSE, 0L); + /* First check if we have color QuickDraw */ + /* (we can assume we have Gestalt because we are on system 7) */ + theError = Gestalt (gestaltQuickdrawFeatures, &gestaltResult); + if ((theError == noErr) && (gestaltResult & (1 << gestaltHasColor) != 0)) + errWindow = NewCWindow(NULL, &tmpRect, "\p", TRUE, dBoxProc, (WindowPtr) -1, FALSE, 0L); + else + errWindow = NewWindow(NULL, &tmpRect, "\p", TRUE, dBoxProc, (WindowPtr) -1, FALSE, 0L); SetPort(errWindow); TextFont(systemFont); @@ -198,7 +205,7 @@ static void MacMessageBox(errbuf) /* mini event loop here */ done = FALSE; while(!done) { - GetNextEvent(mDownMask | mUpMask | keyDownMask, &theEvent); + WaitNextEvent(mDownMask | mUpMask | keyDownMask, &theEvent, 15, nil); if (theEvent.what == mouseDown) { localPt = theEvent.where; GlobalToLocal(&localPt); -- cgit