Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!mips!apple!agate!saturn!ssyx.ucsc.edu!sirkm From: sirkm@ssyx.ucsc.edu (Greg Anderson) Newsgroups: comp.sys.mac.programmer Subject: Re: Finding the size of the screen under Multifinder/Color QD Message-ID: <10164@saturn.ucsc.edu> Date: 3 Jan 90 18:03:20 GMT References: <10139@saturn.ucsc.edu> <9429@hoptoad.uucp> <1102@urbana.mcd.mot.com> Sender: usenet@saturn.ucsc.edu Reply-To: sirkm@ssyx.ucsc.edu (Greg Anderson) Organization: UC Santa Cruz; Division of Social Sciences Lines: 36 In article <1102@urbana.mcd.mot.com> willcox@urbana.mcd.mot.com (David A Willcox) writes: [quoted references to invalid screenbits.bounds deleted] >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 know it's illegal to call InitGraf() from within XCMD's, but can I call it from within a DA? It seems like I would have the same problems you experienced. If I cannot call InitGraf() from within my DA, then how can I find the size of the screen? screenbits.bounds can be used under UniFinder, and I can look at the main screen's gDevice on a system with color quickdraw, but that still leaves me stuck in Multifinder systems that don't have color quickdraw. >Can anyone tell me, is there a better way to get at global variables >such as screenBits from within an XCMD? Sort of -- make callbacks to HyperCard. This won't always get you what you want, but it can often be very helpful. For example, I have an XCMD that centers its dialog on the HyperCard window by making a callback that asks HyperCard where its window is. Under HyperCard, I find it much nicer to have dialogs centered on the HyperCard window rather than the whole screen; that way they look like they're part of HyperCard. Dialogs that center on the whole screen look like system messages. If you'd like, I could send you the source. ___\ /___ Greg Anderson ___\ /___ \ \ / / Social Sciences Computing \ \ / / \ /\/\ / University of California, Santa Cruz \ /\/\ / \/ \/ sirkm@ssyx.ucsc.edu \/ \/