Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!ukc!icdoc!np From: np@doc.ic.ac.uk (Nigel Perry) Newsgroups: comp.sys.mac.programmer Subject: How can I ensure a Rect is visible on screen? Message-ID: <2472@gould.doc.ic.ac.uk> Date: 14 Nov 90 11:20:51 GMT Sender: np@doc.ic.ac.uk Organization: Dept. of Computing, Imperial College, London, UK. Lines: 21 I'm centering dialogs over windows (from an XCMD in HC 2). My current strategy is to first centre the dialog Rect over the window and then check that the Rect is not outside the RgnBBox of the grayRgn - this copes with the window I'm centering over being part of the screen. This works fine for a single screen, but it is possible for a multi-screen setup to have a rectangular hole WITHIN the RgnBBox (i.e. the area above/below a small screen when paired with a large one). Is there a method for ensuring a Rect is within a region and if not moving it so that it is? Thanks in advance --- Nigel Perry Department of Computing Imperial College Janet: np@uk.ac.ic.doc London ARPA: np%uk.ac.ic.doc@ucl-cs SW7 Uucp: np@icdoc.UUCP, ukc!icdoc!np England