Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!apple!well!bschoen From: bschoen@well.sf.ca.us (Brook Schoenfield) Newsgroups: comp.windows.x Subject: Re: Secondary Loop (within XtMainLoop) Problems Summary: XtMainLoop Blocking dialogs information Keywords: XtMainLoop Blocking dialogs Message-ID: <24181@well.sf.ca.us> Date: 13 Apr 91 06:38:06 GMT References: <1991Apr2.080151.10992@neon.Stanford.EDU> <1991Apr3.092416.8894@siesoft.co.uk> Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 47 In article pel@ctron.com (Paul Leclerc) writes: >In article <1991Apr3.092416.8894@siesoft.co.uk> paulb@siesoft.co.uk (Paul Bentley) writes: > >> I have also experienced considerable difficulty in making subsiduary >> event loops work in Motif 1.1 and have spent several days producing short >> (50 lines approx.) example programs. >> >> My opinion is that any problem caused by the use of subsiduary event loops >> is a bug. I have never seen anything in writing to say that they are not >> allowed > >In fact, in the Motif book by Douglas Young, he suggests that the only >way to have blocking dialog boxes is to use another event loop ( page 116). The documentation for the Xt Intrinsics says something like: "there is nothing special about XtMainLoop, it consists of the following two calls: XtNextEvent() XtDispatch() (please forgive me if I have the exact spellings of these off......I have to do my news reading at home) After thinking about this problem for three months and reading these words about 20 times, it finally sunk in that there is nothing special about XtMainLoop(). While callback architecture is encouraged, it is not holy. I do this whenever I need to block for awhile, and I've nested calls. The problems that I've had have all been traced to my own code: if I have forgotton that I've got timer or idle events, weird things do happen. I get rid of anything in the background that I don't need and am careful to watch what events are coming down the pike that I will need to deal with (either by passing through to my own callback routines or by dealing with at the moment: for instance waiting on a keystroke or a button press). By the way, all the Xperts told me this could not be done: redesign. I couldn't afford the time on the project. -- Brook Schoenfield bschoen@well.sf.ca.us