Path: utzoo!attcan!uunet!cs.utexas.edu!samsung!sdd.hp.com!elroy.jpl.nasa.gov!lll-winken!sun-barr!newstop!sun!argv From: argv@turnpike.Eng.Sun.COM (Dan Heller) Newsgroups: comp.windows.x.motif Subject: Re: Blocking actions in Motif and X Keywords: Motif, X, Blocking Message-ID: <138742@sun.Eng.Sun.COM> Date: 11 Jul 90 19:16:00 GMT References: <858@airgun.wg.waii.com> Sender: news@sun.Eng.Sun.COM Organization: O'Reilly && Associates Lines: 34 In article <858@airgun.wg.waii.com> lampshir@airgun.wg.waii.com (gregory b. lampshir) writes: > What I would like to do is use the following code segment > > Boolean answer; > ... > answer = DoNotReturnWithoutAnswer("Do you want to continue?"); > ... > 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 If you look at the WidgetWrap code the I provided for X11R3 (the predicessor to the varargs style interface now used in X11R4), there is a demo program that does precisely this. It's not geared towards motif -- it uses athena widgets by default. However, it is very simple to generalize this for Motif or any arbitrary widget set. I get requests for this all the time, so rather than ask me for it, please get it out of the old R3 distribution (in contrib/widgets) or query your local s-xources archive site (or uunet). It's volume 3 issue 76. It's also in the WidgetWrap directory in "contrib" on expo. -- dan ---------------------------------------------------- O'Reilly && Associates argv@sun.com / argv@ora.com Opinions expressed reflect those of the author only.