Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!rosie!elvis From: sstreep@elvis (Sam Streeper) Newsgroups: comp.sys.next Subject: Re: Drawing String in a View (Reply Needed ASAP) Message-ID: <887@rosie.NeXT.COM> Date: 4 Jun 91 17:03:51 GMT References: <1991Jun3.164701.9219@svc.portal.com> Sender: news@NeXT.COM Lines: 38 Nntp-Posting-Host: elvis.next.com In article <1991Jun3.164701.9219@svc.portal.com> moose (Michael Rutman) writes: > ... and why should he do an NXPing()? The window server will never be > more than an eyeblink behind an NXPing(). Or do I misunderstand NXPing(). NXPing() guarantees 2 things for you. First, you know all your postscript code has been flushed to the window server. Second, it does not return until that code has been rendered. Other things can do one or both of these functions, so it is not always necessary. For example, any time you wait on an event (either by returning to the event loop or explicitly by using Application's getEvent: method) you know that your postscript code has been flushed to the window server. (Remember, though, that the rendering is asynchronous). Any time you call a wrapped postscript function that returns a value, the wrap both flushes and waits for the code to be executed (rendered) before returning. While I'm on the subject, maybe I'll bring up some NXPing religion. Your app can spew postscript to the window server much faster than the window server can render it, so it's possible for your app to get way ahead of the WS. When this happens, the relationship between a user action and the drawing that happens at that time (apparently in response to the action of the moment) gets mushy. Mouse dragged events are coalesced by default, so if you NXPing and the next event is a drag event, your next drawing will actually reflect the current position of the mouse. Pinging can definitely slow you down, because it can force extra communication between the app and the window server, and this communication is not always necessary. It can also speed up rendering, because the app stops competing with the window server for CPU time until the rendering is done. As always, there is no single correct answer, and your mileage may vary. -sam -- Opinions are not those of my employer. They're not even mine. They're probably wrong besides. How did they get in here, anyway?