Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!slug!wex From: wex@dali.pws.bull.com (Buckaroo Banzai) Newsgroups: comp.windows.x.motif Subject: Re: Multiple Displays in Xt (again) Message-ID: Date: 13 Nov 90 15:19:42 GMT References: <903@attc.UUCP> Sender: news@pws.bull.com Distribution: comp.windows.x.motif Organization: Bull Worldwide Information Systems Inc. Lines: 33 Nntp-Posting-Host: dali.pws.bull.com In-reply-to: marbru@attc.UUCP's message of 9 Nov 90 05:48:39 GMT In article <903@attc.UUCP> marbru@attc.UUCP (Martin Brunecky) writes: In article pop@linus.mitre.org (Paul O. Perry) writes: > From hagerman@ece.cmu.edu Wed Nov 7 14:59:32 1990 > So I tried to work around the problem with a gross hack: I initialize > the toolkit, and then for each display I create an application context > and do an XtOpenDisplay. Then instead of XtAppMainLoop I use my own > >I don't see this as a gross hack, this is the way I thought you would >have to support multiple displays. I would improve the event loop by I think you are wrong here. My programs use a single app-context, multiple XtOpenDisplay and work just fine. Creating multiple app-contexts only causes problems. The toolkit has been designed to deal with multiple displays under a single app context, and (unless you have a bad version of toolkit) it does it right. Brunecky is right, but for the wrong reasons. You do not *have* to create multiple application contexts - it's possible to get many displays working under a single context. HOWEVER, he's wrong that it's a "gross hack." In many cases, there are things that are specific to an application context that you'd like to have be different for different users. In these cases, you do indeed need more than one application context. In some cases, you may in fact need one application context per display. Having these additional structures does make your program a lot more unwieldy, so you shouldn't use them unless you really need them. But there are also some extremely neat tricks you can do once you've got them there. -- --Alan Wexelblat phone: (508)294-7485 Bull Worldwide Information Systems internet: wex@pws.bull.com Never worry about theory as long as the machinery does what it's supposed to do.