home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / mac / programm / 18125 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.8 KB  |  36 lines

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