Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!rpi!bu.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!captkidd From: captkidd@athena.mit.edu (Ivan Cavero Belaunde) Newsgroups: comp.sys.mac.programmer Subject: Re: writing to a window without selecting it. Message-ID: <1991Apr9.182240.9074@athena.mit.edu> Date: 9 Apr 91 18:22:40 GMT References: <1991Apr9.034248.6761@hub.cs.jmu.edu> Sender: news@athena.mit.edu (News system) Distribution: comp Organization: Massachusetts Institute of Technology Lines: 26 In article <1991Apr9.034248.6761@hub.cs.jmu.edu> jmidili@hub.cs.jmu.edu (jeff midili) writes: >Lots of programs like MacDraw, MacDraft, etc have a small window >seperate of the main image window that displays the x,y coordinates >of the mouse pointer withen the image. I have written a program >that displays a pix image, and now I want to add the small window that >will display the x,y coordinates of the mouse when it is in the >window. I can do it now, but only by selecting the coordwindow during >each NULL event and drawstringing the coordinates in the coordwindow. >The problem with this is that for each NULL event I Select the coord- >window, draw in it, and then Select my image window. This creates >unsightly flickering in each window. If what you mean by "selecting" the window is calling SelectWindow on it, (thereby bringing it to the front) you don't have to do that. You can just do: oldPort = GetPort(); SetPort (myCoordWindow); DrawMyStuff (); SetPort (oldPort); QD takes care of all the clipping and stuff for you. -Ivan Cavero Belaunde Visualist Digital Video Applications Corp. (DiVA) Internet: captkidd@ATHENA.MIT.EDU