Path: utzoo!utgpu!water!watmath!clyde!att!ucbvax!decwrl!palo-alto!vixie From: vixie@palo-alto.DEC.COM (Paul Vixie) Newsgroups: comp.windows.x Subject: Re: X Toolkit and continuous graphic output Message-ID: <3579@palo-alto.DEC.COM> Date: 25 Jul 88 20:23:50 GMT References: <8807240059.AA13157@violet.berkeley.edu> Organization: DEC Western Research Lab Lines: 28 In <8807240059.AA13157@violet.berkeley.edu> rusty@VIOLET.BERKELEY.EDU writes: # Suppose I have a program that continuously computes and generates # graphic output; how can I wrap the toolkit around this program? It # seems to me that once I call XtMainLoop() I've given up control and # there's no way for me to get to the main routine of my program that # generates the output. You say you want to "continuously" compute and display graphics; if this is indeed the case, I assume that you want the toolkit to interrupt you in the form of button callbacks getting called if the user clicks something. You should do: while (XtPending()) { XEvent xevent; XtNextEvent(&xevent); XtDispatchEvent(&xevent); } This will give Xt a chance to do anything it could want to do, callback-wise. If you look at the source for XtMainLoop(), you'll see that there's no magic involved there, either. -- Paul Vixie Digital Equipment Corporation Work: vixie@dec.com Play: paul@vixie.UUCP Western Research Laboratory uunet!decwrl!vixie uunet!vixie!paul Palo Alto, California, USA +1 415 853 6600 +1 415 864 7013