Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!dlyons From: dlyons@Apple.COM (David Lyons) Newsgroups: comp.sys.apple Subject: Re: 2 more IIGS programming questions Message-ID: <32788@apple.Apple.COM> Date: 29 Jun 89 20:51:56 GMT References: <9760@boulder.Colorado.EDU> <32779@apple.Apple.COM> Organization: Apple Computer Inc, Cupertino, CA Lines: 32 In article <32779@apple.Apple.COM> dlyons@Apple.COM (David Lyons) writes: [...] >You can use GetPortRect to find out which part of the window you're scrolled >to, or you can get the bounding box of the update region. More details on >request--gotta take off! Let me try this once more, not under time pressure this time. Inside your content-draw routine, BeginUpdate has already been called by the system, so what you want to do is get the bouding box of the VisRegion (try GetVisHandle()^^.bBox to get the smallest rectangle that encloses the part of the window that needs to be updated. BeginUpdate temporarily replaces the window's VisRegion with the intersection of the VisRegion and the Update region. The bounding box of a region is stored in bytes 2-9 (the 3rd-10th bytes) of the block of memory the region's handle refers to. The part about GetPortRect is true, but checking the VisRegion is generally better, since it often gives you a smaller area to draw (GetPortRect will give you the part that the window is "scrolled to", but not all of that really needs to be drawn). --Dave Lyons, Apple Computer, Inc. | DAL Systems AppleLink--Apple Edition: DAVE.LYONS | P.O. Box 875 AppleLink--Personal Edition: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.