home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18731 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.9 KB  |  56 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!jvnc.net!primerd.prime.com!usenet
  3. From: Jim Cook <J.Cook@ENS.Prime.COM>
  4. Subject: Re: Invalidating the Entire Screen?
  5. Message-ID: <1992Nov20.214447.27552@primerd.prime.com>
  6. Sender: usenet@primerd.prime.com (Usenet)
  7. Reply-To: <J.Cook@ENS.Prime.COM>
  8. Organization: Prime Computer, Inc.
  9. References: <1992Nov19.220447.11714@primerd.prime.com> <9211191547.aa28279@Paris.ics.uci.edu>
  10. Date: Fri, 20 Nov 1992 21:44:47 GMT
  11. Lines: 43
  12.  
  13. In article <9211191547.aa28279@Paris.ics.uci.edu> kanderso@mabillon.ICS.UCI.EDU
  14. (Kenneth Anderson) writes:
  15. >In comp.sys.mac.programmer you write:
  16. >
  17. >>Is there an easy one call should do it all?
  18. >
  19. >Here is code that I saved, because it is the only code to date that
  20. >Ben Haller has posted to the net.  I believe it does what
  21. >you need...
  22. >
  23. >>void InvalScreen()
  24. >>{
  25. >>        DrawMenuBar();
  26. >>        PaintOne(0L,GrayRgn);
  27. >>        PaintBehind(WindowList,GrayRgn);
  28. >>}
  29. >
  30. >After posting this code, Ben stated:
  31. >
  32. >>I believe this is the only code I have ever posted that is copied
  33. >>directly from Solarian II, so all you people who have been slavering
  34. >>over the (imagined) prospect of getting Sol source out of my tight
  35. >>little fists, rejoice!
  36.  
  37. This worked, though it took me a couple hours to debug (call me slow).
  38. The problem is that most people will probably execute this code and leave,
  39. therefore avoiding any problems.  
  40.  
  41. The problems one should be aware of are:
  42.  
  43. 1. DrawMenuBar should not be called with anything in the menu bar hilited.
  44.    IM Vol 1 warns about this.
  45.  
  46. 2. Both PaintOne and PaintBehind muck with the current value of qd.thePort.
  47.    Therefore, do a GetGWorld at the beginning of this call and a SetGWorld
  48.    after each of the calls (well, you probably could just do one set at the
  49.    end, but I was frustrated and ultimately played it safe).
  50.  
  51. Thanks to all!
  52. The net comes thru again!
  53.  
  54. Jim
  55.  
  56.