Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!gatech!prism!loligo!pepke From: pepke@loligo.cc.fsu.edu (Eric Pepke) Newsgroups: comp.sys.mac.programmer Subject: Re: Saving window position question Keywords: Window, MultiFinder Message-ID: <226@loligo.cc.fsu.edu> Date: 28 Jul 89 15:57:56 GMT References: <505@suna.CMI.COM> <7889@hoptoad.uucp> <12616@well.UUCP> Reply-To: pepke@loligo.UUCP (Eric Pepke) Distribution: usa Organization: Supercomputer Computations Research Institute Lines: 26 The saved position and size may no longer be valid when the document is opened on a Macintosh with a different configuration of screens, so that must be checked as well. How are people out there doing it? My favorite way of doing this for a standard document window is 1) Store the desired rectangle of the content region in a variable windowRect. 2) Make a variable barRect such that barRect . top = windowRect . top - 13; barRect . bottom = windowRect . top - 5; barRect . left = windowRect . left + 4; barRect . right = windowRect . right - 4; 3) Determine if this intersects GetGrayRgn(). This seems to be consistent with the criteria that DragWindow uses to determine whether a window position is reasonable or not, or at least it's close. Are there any better ways? Eric Pepke INTERNET: pepke@gw.scri.fsu.edu Supercomputer Computations Research Institute MFENET: pepke@fsu Florida State University SPAN: scri::pepke Tallahassee, FL 32306-4052 BITNET: pepke@fsu Disclaimer: My employers seldom even LISTEN to my opinions. Meta-disclaimer: Any society that needs disclaimers has too many lawyers.