home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!sokoloff
- From: sokoloff@athena.mit.edu (James T Sokoloff)
- Subject: Re: Spurious invalidation
- Message-ID: <1992Nov7.172136.7170@athena.mit.edu>
- Sender: news@athena.mit.edu (News system)
- Nntp-Posting-Host: carbonara.mit.edu
- Organization: Massachusetts Institute of Technology
- References: <1992Nov6.170232.21241@alw.nih.gov> <absurd-061192133636@seuss.apple.com>
- Date: Sat, 7 Nov 1992 17:21:36 GMT
- Lines: 23
-
- In article <absurd-061192133636@seuss.apple.com> absurd@apple.apple.com (Tim Dierks, software saboteur) writes:
- >In article <1992Nov6.170232.21241@alw.nih.gov>, fixer@faxcsl.dcrt.nih.gov
- >(Chris Spiral Catfish Tate) wrote:
- >> Problem: calling SetCTitle() (and possibly SetCtlValue()) on controls in the
- >> dialog is forcing an update. This is pretty bad in my case, since redrawing
- >> the dialog is rather time-consuming.
- >
- >Sure enough, controls will invalidate themselves (or the control manager
- >does it; I can't remember). This isn't the real problem; the problem is
- >that your user items are being drawn when they don't need to be. I would
- >stick a little code at the beginning of your user item drawing procedure
- >that makes sure that your user item intersects the union of the visRgn and
- >the clipRgn; this way you can be sure that your user item actually
- >needs to be redrawn before undertaking the task. (For extra points,
- >only redraw the bits that need to be redrawn.)
- >
- >Tim Dierks
- The region to check is the Intersection (SectRgn) (I-184) of the visRgn
- & clipRgn. The UnionRgn would (under most cases) not avoid any drawing.
- SectRgn will correctly compute the region of interest.
-
- Other than that, this *is* the correct way to speed up the drawing...
- ---Jim Sokoloff
-