Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!wsl.dec.com!klee From: klee@wsl.dec.com (Ken Lee) Newsgroups: comp.windows.x Subject: Re: How do *you* handle multiple displays? Message-ID: <1991Jun26.131122@wsl.dec.com> Date: 26 Jun 91 20:11:22 GMT References: <14246@maslow.ptolemy-ri.arc.nasa.gov> Sender: news@pa.dec.com (News) Reply-To: klee@wsl.dec.com Organization: DEC Western Software Laboratory Lines: 24 In article <14246@maslow.ptolemy-ri.arc.nasa.gov>, fineman@ptolemy-ri.arc.nasa.gov (Charles Fineman) writes: |> I'm working on a performance visualization package and I would like to |> give the user the option of displaying views on multiple screens. The |> problem comes when trying to wait for events from the different |> windows. If the windows are handled by different display servers, the |> event wait loop turns into a spin-loop since there is no way to do a |> blocking request for events from multiple servers (right???). If you're using the X Toolkit, just put all the displays in the same application context and call XtAppMainLoop. The X Toolkit automatically handles all the different displays properly. If you're not using the X Toolkit (why aren't you?), you have to use operating system dependent techniques for blocking on multiple connections. In systems derived from BSD UNIX, the ConnectionNumber() macro will give you the socket descriptor. You can pass these to select(), which will block on all the connections until one is ready for reading. -- Ken Lee DEC Western Software Laboratory, Palo Alto, Calif. Internet: klee@wsl.dec.com uucp: uunet!decwrl!klee