Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!bloom-beacon!athena.mit.edu!kit From: kit@athena.mit.edu (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: Basic questions on X Toolkit Intrinsics Keywords: Toolkit, XtGrabExclusive Message-ID: <8118@bloom-beacon.MIT.EDU> Date: 22 Nov 88 21:31:45 GMT References: <5136@mit-vax.LCS.MIT.EDU> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: kit@athena.mit.edu (Chris D. Peterson) Organization: Massachusetts Institute of Technology Lines: 33 > What I want is to write a routine that does not return until a widget > has been closed. Is that what XtPopup does? This is not simple, perhaps the following method will serve your purposes. ( I realize it seems like I am telling you how to get around the problem, rather then how to solve it). Create two routines rather than one, Setup() and Shutdown(). Setup() This routine pops up your XtGrabExclusive window that has Shutdown() as the proceedure that is called when the user acknowledges your message window. It then exits back to XtMainLoop(). Since you have GrabExclusive set the only routine that can be called is Shutdown(), so in essence you are blocking until the user acknowledges your message. Shutdown() Pops down the window, allowing the program to continue. I think this method is cleaner than trying to have a event handler in the middle of your code. As long as you comment it well the program flow should not be any harder to follow than the other toolkit code :-) Chris D. Peterson Project Athena Systems Development Net: kit@athena.mit.edu Phone: (617) 253 - 1326 USMail: MIT - Room E40-342C 77 Massachusetts Ave. Cambridge, MA 02139