Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Finding the size of the screen under Multifinder/Color QD Message-ID: <9429@hoptoad.uucp> Date: 29 Dec 89 21:27:47 GMT References: <10139@saturn.ucsc.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 32 In article <10139@saturn.ucsc.edu> sirkm@ssyx.ucsc.edu (Greg Anderson) writes: >TN #117 says to look at the QuickDraw variable screenbits.bounds to >find the size of the screen, but on my Mac IIx, this rectangle is >always (0,0,0,0) when MultiFinder is installed (color or b&w). Uh, I really don't think so. Check again. >The Q&A stack says to "look at all gDevices", taking the union of each >screen rectangle to find the total region that makes up the screen, >but I'm somewhat unclear on how to do this. The way to do it for dragging is to call GetGrayRgn() (IM vV) and use its bounding box. But this isn't what you're doing.... >The reason I wish to know the size of the screen is simply to center my >dialogs on the screen. Given this purpose, should I just look at one >gDevice (namely, the one returned by GetGDevice)? Once I have this handle, >how should I determine the screen bounds? Get the PixMap from >(*gDev)->gdPMap and then look at pixMap.bounds? You probably don't want to center dialogs across all monitors. You want to center them on the main screen. So use screenBits.bounds to get the rectangle of the main screen. It's *not* an empty rectangle on a properly functioning Macintosh. The Window Manager chapter of Inside Mac volume V continues to endorse its use. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "But don't you see, the color of wine in a crystal glass can be spiritual. The look in a face, the music of a violin. A Paris theater can be infused with the spiritual for all its solidity." -- Lestat, THE VAMPIRE LESTAT, Anne Rice