Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!usc!zaphod.mps.ohio-state.edu!think!ames!pacbell!att!mcdchg!mcdphx!udc!willcox From: willcox@urbana.mcd.mot.com (David A Willcox) Newsgroups: comp.sys.mac.programmer Subject: Re: Finding the size of the screen under Multifinder/Color QD Message-ID: <1102@urbana.mcd.mot.com> Date: 2 Jan 90 19:09:34 GMT References: <10139@saturn.ucsc.edu> <9429@hoptoad.uucp> Reply-To: willcox@urbana.mcd.mot.com (David A Willcox) Organization: Motorola Microcomputer Division, Urbana IL Lines: 31 In article <9429@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >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. This sounds a bit like what happened when I tried to use screenBits from within an XCMD. The problem, of course, was that I hadn't called InitGraf() (I hope that's the right name) from within my XCMD, and I was seeing a local copy of screenBits that had not been initialized. (I'm using Think C 3.0.) I tried calling InitGraf() within my XCMD, and that gave me valid values for screenBits, but things rapidly went to hell on return to HyperCard, since HyperCard's quickdraw globals didn't work any more. (Obvious, in hindsight.) I managed to do what I wanted to do (center a dialog in the window) by looking at the grafport that was active on entry to the XCMD. It worked, but I worry that it might break under some conditions. Can anyone tell me, is there a better way to get at global variables such as screenBits from within an XCMD? David A. Willcox Motorola Urbana Design Center UUCP: ...!uiucuxc!udc!willcox 1101 E. University Ave. INET: willcox@urbana.mcd.mot.com Urbana, IL 61801 FONE: 217-384-8534