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

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!sdd.hp.com!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!ames!haven.umd.edu!decuac!pa.dec.com!decwrl!apple!mumbo.apple.com!gallant.apple.com!seuss.apple.com!user
  3. From: absurd@apple.apple.com (Tim Dierks, software saboteur)
  4. Subject: Re: Spurious invalidation
  5. Sender: news@gallant.apple.com
  6. Message-ID: <absurd-061192133636@seuss.apple.com>
  7. Date: Fri, 6 Nov 1992 22:42:36 GMT
  8. References: <1992Nov6.170232.21241@alw.nih.gov>
  9. Organization: MacDTS Marauders
  10. Followup-To: comp.sys.mac.programmer
  11. Lines: 21
  12.  
  13. In article <1992Nov6.170232.21241@alw.nih.gov>, fixer@faxcsl.dcrt.nih.gov
  14. (Chris Spiral Catfish Tate) wrote:
  15. > Problem: calling SetCTitle() (and possibly SetCtlValue()) on controls in the
  16. > dialog is forcing an update.  This is pretty bad in my case, since redrawing
  17. > the dialog is rather time-consuming.
  18. > Does anyone have any idea what's happening, and how I might go about preventing
  19. > it?  Calling ValidRect() on the slow-to-draw userItem's rectangle after the
  20. > call to SetCTitle() doesn't seem to solve the problem; it's still updated.
  21.  
  22. Sure enough, controls will invalidate themselves (or the control manager
  23. does it; I can't remember).  This isn't the real problem; the problem is
  24. that your user items are being drawn when they don't need to be.  I would
  25. stick a little code at the beginning of your user item drawing procedure
  26. that makes sure that your user item intersects the union of the visRgn and
  27. the clipRgn; this way you can be sure that your user item actually
  28. needs to be redrawn before undertaking the task.  (For extra points,
  29. only redraw the bits that need to be redrawn.)
  30.  
  31. Tim Dierks
  32. MacDTS, why not?
  33.