Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!mips!apple!rutgers!bpa!tci!kingman From: kingman@tci.bell-atl.com (Matt Kingman) Newsgroups: comp.sys.mac.programmer Subject: Re: Help figuring screen size in a DA! Message-ID: <696@tci.bell-atl.com> Date: 16 Feb 90 17:23:40 GMT References: <1990Feb15.164818.24121@ncsuvx.ncsu.edu> Distribution: usa Organization: Technology Concepts, Inc. Sudbury Mass. Lines: 30 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. One quick and dirty way is to open a GrafPort and look at the portRect. This is a method I used in a couple of cdevs I wrote to center dialog boxes on the screen. Here's an excerpt... ---- Rect screenBounds; GrafPort gp; /* ** Get the size of the screen by opening a phony port ** because we can't access screenBits.bounds. */ OpenPort(&gp); screenBounds = gp.portRect; ClosePort(&gp); ---- /Matt -- Matt Kingman - Systems Engineer kingman@tci.bell-atl.com Technology Concepts Inc. ...!uunet!tci!kingman Sudbury, MA. 01776 (508)443-7311 TCI is not responsible for my opinions, nor I for theirs...