Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!usc!ucsd!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: informational dialog help Message-ID: <33127@ucbvax.BERKELEY.EDU> Date: 9 Dec 89 07:59:17 GMT References: <1850@neoucom.UUCP> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 51 In article <1850@neoucom.UUCP> sam@neoucom.UUCP (Scott A. Mason) writes: >I would like to display an informational dialog box that contains >predefined static text items only. While this box is on the screen, I want >to call a few procedures in my C program. When the procedures finish, I >want the box to go away. Sounds pretty simple. Handle GetDIHandle(i)Integer i;{ short theType; Handle theHandle; Rect theRect; GetDItem(thePort, i, &theType, &theHandle, &theRect); return theHandle; } DialogPtr gMesgDia; BeginMessage(){ GrafPtr savePort; GetPort(&savePort); if(NIL == (gMesgDia = GetNewDialog(resID, NIL, (WindowPtr) -1L))){ return; } SetPort(gMesgDia); SetIText(GetDIHandle(textITEM), (StringPtr) "\pYour message here."); ShowWindow(thePort); DrawDialog(thePort); SetPort(savePort); } EndMessage(){ if(NIL != gMesgDia){ DisposDialog(gMesgDia); gMesgDia = NIL; } } Now, just say: BeginMessage(); ... do your work ... EndMessage(); You might also look at your event loop, and see if you are calling isDialogEvent() and DialogSelect() there. You should be. See Inside Mac for more info on those two calls. --- David Phillip Oster -- No, I come from Boston. I just work Arpa: oster@dewey.soe.berkeley.edu -- in cyberspace. Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu