Path: utzoo!utgpu!jarvis.csri.toronto.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: <9481@hoptoad.uucp> Date: 3 Jan 90 23:43:18 GMT References: <10139@saturn.ucsc.edu> <9429@hoptoad.uucp> <1102@urbana.mcd.mot.com> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 42 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). In article <9429@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >>Uh, I really don't think so. Check again. In article <1102@urbana.mcd.mot.com> willcox@urbana.mcd.mot.com (David A Willcox) writes: >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.) When I first read this, I though, "Of course!" But now, I'm not sure this makes sense. The XCMD should be called using HyperCard's A5, and its QD globals are initialized already. Maybe the problem is that LSC has a bug that looks for the QD globals off A4 if you are linking a code resource? That wouldn't be too surprising. But the LSC code resource glue doesn't mess about with the caller's A5, which should remain constant throughout. >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.) Sort of. This seems to be compatible with the A4-bug hypothesis, assuming that the code generated was using offsets from A4 and you passed a pointer to thePort which was also A4-relative. >Can anyone tell me, is there a better way to get at global variables >such as screenBits from within an XCMD? Tell me, did you try the ugly way of accessing QD globals from assembly language, from IM I-163? I bet it would work. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "Gorbachev is returning to the heritage of the great Lenin" - Ronald Reagan