Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!amdahl!twg.com!lefty From: lefty@twg.com (David N. Schlesinger) Newsgroups: comp.sys.mac.programmer Subject: Re: Help figuring screen size in a DA! Message-ID: <168@gollum.twg.com> Date: 20 Feb 90 17:57:07 GMT References: <1990Feb15.164818.24121@ncsuvx.ncsu.edu> Sender: news@twg.com Distribution: usa Organization: The Wollongong Group Lines: 29 In article <1990Feb15.164818.24121@ncsuvx.ncsu.edu> jbritt@shumv1.ncsu.edu (Joe Britt) writes: > I am writing my first DA and need to figure out the size of the screen. > I realize that DA's don't have an A5 World, and so also don't have a set > of QD globals with goodies like screenBits. What I'm looking for is > help on a good way to go about figuring out the screen size. What I'd do is use the GrafPort pointed to by the low-memory global WMgrPort (at location 0x9DE). Something like the following: #define WMgrPort (*((GrafPort *) 0x9DE)) wmPort = WMgrPort; BlockMove(wmPort->portRect, myBounds, sizeof(Rect)); This probably won't work on multiple-screen systems, but it's worked for me in the past. Specifically, I've used it for centering dialog windows from Control Panel devices... Hope this helps... Lefty =========================================================================== David N. Schlesinger || "There's a word for it: words don't The Wollongong Group || mean a thing. There's a name for it; Internet: Lefty@twg.com || names make all the difference in the POTS: 415/962-7219 || world..." -- David Byrne ===========================================================================