🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #24031

Re: question about querying user synchronously in Xt

#24031
From: Dan Heller
Date: Mon, 24 Jun 1991 15:03
42 lines
2306 bytes
On Jun 19, 11:09am, Tom Tulinsky wrote:
> In the X Frequently Asked Questions list, no. 106, some code is given
> that allows you to query the user at a given point in  a program and
> not proceed past that point until he answers.  To do this it uses a
> private event loop:         

The original code was mine, but pass it around the net a while and
it sure doesn't look like what I wrote anymore... :-)   anyway...

>          (create modal dialog box)
>          while (answer == RET_NONE || XtAppPending(context)) {
>                 XtAppProcessEvent (context, XtIMAll);
>          }
>          (answer is a global which is set by the callbacks of the dlg
>           box)
> 
> I'm wondering why XtAppPending() is in the while condition.  Would
> this work just as well?
> 
>    while(answer==RET_NONE) {
>       XtAppProcessEvent (context, XtIMAll);
>    }

The XtAppPending() was originally intended to allow the dialog to
destroy itself in the callback routine and let the 2 phase destroy
operation for widgets complete, generating the resulting Expose
events that happen on any of the windows that were obscured by the
dialog.  The XtAppPending() will catch and process those destroy
events so that when this function returns, you know that the user
is no longer looking at the dialog ... more of an aesthetic issue
than anything else.

This is all explained in the upcoming O'Reilly Volume 6,
Motif Programmer's Manual due late august or so...  Sorry
I haven't been very prolific on this mailing list -- I've
been hiding out in other lists lately..

-- 
Dan Heller
O'Reilly && Associates       Z-Code Software    Comp-sources-x:
Senior Writer                President          comp-sources-x@uunet.uu.net
argv@ora.com                 argv@zipcode.com
Technical Details
Message-ID: <9106241503.AA00501@tribbles.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!bloom-beacon!dont-send-mail-to-path-lines

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!bloom-beacon!dont-send-mail-to-path-lines
From: Dan.Heller@Eng.Sun.COM (Dan Heller)
Newsgroups: comp.windows.x
Subject: Re: question about querying user synchronously in Xt
Message-ID: <9106241503.AA00501@tribbles.Eng.Sun.COM>
Date: 24 Jun 91 15:03:47 GMT
Sender: daemon@athena.mit.edu (Mr Background)
Reply-To: <uunet!zipcode.com!argv@uunet.uu.net>
Organization: The Internet
Lines: 42