Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!ira.uka.de!smurf!urlichs From: urlichs@smurf.sub.org (Matthias Urlichs) Newsgroups: comp.sys.mac.programmer Subject: Re: Remembering window locations Message-ID: Date: 22 Jan 91 10:20:29 GMT References: <1991Jan20.092039.13132@nada.kth.se> Organization: University of Karlsruhe, FRG Lines: 36 In comp.sys.mac.programmer, article <1991Jan20.092039.13132@nada.kth.se>, d88-jwa@dront.nada.kth.se (Jon W{tte) writes: < < You check that the top left corner is within GetGrayRgn ( ). < I think it's nicer to check if the title bar is anywhere in the GrayRgn (maybe InsetRgn()'ed a few pixels). I often place some windows flush left on my screen, or a few pixels left to that. IMHO, the important thing is that the user has some way to get at the title bar. If I place my window at the lower left corner of the screen so that just the zoom box is visible, your application should make the window reappear there. < } else { < /* Use your default - screenBits . bounds maybe. < GrayRgn . rgnbBBox covers _all_ screens, and thus < is less optimal ;-) */ Moreover, some weird monitor setups would hide the close box, zoom box, and resize icon of the window. That's OK if I want the window to be there, but for a new or auto-sized window this is definitely not a good idea... < DisposHandle ( theFoo ) ; Hmm, right now it doesn't seem to matter, but Apple recommends that you use the region handling calls to manipulate regions. They may conceivably be stored somewhere inside a graphics processor. So, you should use NewRgn and CopyRgn to duplicate a region, and DisposRgn to destroy one, instead of HandToHand and DisposHandle. -- Matthias Urlichs -- urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de /(o\ Humboldtstrasse 7 - 7500 Karlsruhe 1 - FRG -- +49+721+621127(0700-2330) \o)/