Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!BBN.COM!aparisi
From: aparisi@BBN.COM (Corporal Jones)
Newsgroups: comp.windows.x
Subject: Re:  help (with a popup prompt design)
Message-ID: <8908180033.AA00450@expo.lcs.mit.edu>
Date: 17 Aug 89 19:13:17 GMT
Sender: daemon@bloom-beacon.MIT.EDU
Organization: The Internet
Lines: 21

Actually, there may be a very good reason to nest an event loop.

Say you need to implement a command-driven style of interaction within a
toolkit application.  I know we are trying to avoid this at all costs in
the Brave New World of the future, but there are some large, monolithic,
command-driven applications out there that people are converting to X.
Often a first step in the conversion is to provide GUI front ends to a
subset of the functionality, and provide a command-driven escape hatch (for
example, a DECWindows Command widget) for the non-converted functionality.

In this scenario, the application will want the main thread to be blocked
on a command read until a command is actually entered.  The way to do the
block is to nest an event loop (NOT XtMainLoop, naturally-- as you said,
how will it return?) in the procedure that does the read from the command
widget.  The event loop would terminate when a command is entered.  (It
probably detects this using a semaphore that is set by the command widget's
commandEntered callback).

Tony Parisi
BBN Software Products
Cambridge, MA