Path: utzoo!attcan!uunet!airgun!lampshir From: lampshir@airgun.wg.waii.com (gregory b. lampshire) Newsgroups: comp.windows.x Subject: blocking and X Keywords: blocking, X, Motif Message-ID: <860@airgun.wg.waii.com> Date: 10 Jul 90 19:12:37 GMT Organization: Western Geophysical, Houston Lines: 54 Greeting peoples.... I am hoping that all you Motif experts out there can help me on a small problem I am having. What I wish to do is create an application modal, blocking yes/no widget. Let me explain. I am writing a program that must ask alot of yes/no questions. These questions are critical and hence, the program cannot continue without them. What I would like to do is use the following code segment Boolean answer; ... answer = DoNotReturnWithoutAnswer("Do you want to continue?"); ... to return an answer. However, in the event driven environment, even with the widget's dialog type set to application modal, the func 'DoNotReturnWithoutAnswer' returns before the user can respond. The yes/no widget, however, is left displayed waiting for the user in an event driven manner. What I really need is to block until the user responds, could someone give me some skeleton code to show me how to do this? The sequence of events should be thus.... 1) call the yes/no func 2) popup a small window with the question string as the display string 3) create a yes and a no push button 4) block and grab the pointer (confined to the yes/no window box) until the user responds 5) return either True or False I have made some progress. Using Intrinsics and the XtPopup() group of funcs I can make the widget popup (without any fancy borders which is what I wanted anyway) and display the two push buttons with label string. No problem. I even grabbed the pointer. However, the event loop necessary for the blocking action is still alittle beyond me. How about some help? I know someone has already written something similar (I think in the UK group) but did it do blocking. I would appreciate someone sending me the source if they have it. Please do not flame me if this issue has been brought up many times before, I am a new reader of this newsgroup. gregory lampshire | Searching for a computer which can do it western geophysical | all...... -- Gregory B. Lampshire | DOMAIN lampshir@airgun.wg.waii.com Western Geophysical | UUNET uunet!airgun!lampshir