Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!purdue!bu-cs!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph R Swick) Newsgroups: comp.windows.x Subject: Re: Xt and applications that do non-window-related processing Message-ID: <8902161438.AA22883@LYRE.MIT.EDU> Date: 16 Feb 89 14:38:52 GMT References: <626@arisia.Xerox.COM> Sender: daemon@bloom-beacon.MIT.EDU Organization: DEC/MIT Project Athena Lines: 16 > Suppose I wanted to write an application that sat in an infinite > loop and only every so often checked for input from X. The basic technique is to use XtAppPending() to poll the various sources of input known to Xt. You could look at the implementation of XtAppMainLoop() to see how to write your own, but it should be pretty clear from the documentation. An alternative method is to have Xt call your infinite loop as a "work procedure". You merely need to return from your loop every so often to have Xt do it's thing. The more often you return, the better X response you'll get. Which you choose may be more a matter of style than anything else, but there's a subtle difference in the implicit priority of your compute loop and the X events in the two cases.