Path: utzoo!attcan!uunet!maverick.ksu.ksu.edu!ux1.cso.uiuc.edu!pequod.cso.uiuc.edu!dorner From: dorner@pequod.cso.uiuc.edu (Steve Dorner) Newsgroups: comp.sys.mac.programmer Subject: Re: How can I ensure a Rect is visible on screen? Message-ID: <1990Nov15.152425.8139@ux1.cso.uiuc.edu> Date: 15 Nov 90 15:24:25 GMT References: <2472@gould.doc.ic.ac.uk> Sender: news@ux1.cso.uiuc.edu (News) Reply-To: dorner@pequod.cso.uiuc.edu (Steve Dorner) Organization: University of Illinois at Urbana-Champaign Lines: 19 In article <2472@gould.doc.ic.ac.uk> np@doc.ic.ac.uk (Nigel Perry) writes: >a large one). Is there a method for ensuring a Rect is within >a region RectInRgn will tell you if part of the rectangle is in the region. Once you know that, use RectRgn to make a region of the rectangle. SectRgn this with the region you're interested in. Use EqualRgn to see if the intersection is the same as the rectangle's region. >and if not moving it so that it is? Now there's an interesting problem. I'm not convinced that centering a dialog on a window is a good idea if it results in the dialog being split over multiple screens, but you probably aren't interested in my opinion. -- Steve Dorner, U of Illinois Computing Services Office Internet: s-dorner@uiuc.edu UUCP: uunet!uiucuxc!uiuc.edu!s-dorner