home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15357 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.7 KB  |  39 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!gumby!kzoo!k044477
  3. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  4. Subject: Re: GetColor bug (was RE: NON-QUICKDRAW GAMES)
  5. Message-ID: <1992Sep11.171207.28711@hobbes.kzoo.edu>
  6. Organization: Kalamazoo College
  7. References: <14973@mindlink.bc.ca> <28629@vedge.UUCP> <1992Sep11.005924.21955@dartvax.dartmouth.edu>
  8. Date: Fri, 11 Sep 1992 17:12:07 GMT
  9. Lines: 28
  10.  
  11. Joe.Francis@dartmouth.edu (Joe Francis) writes:
  12. >brad@vedge.UUCP (Brad Fowlow) writes:
  13. >
  14. >> Any thoughts on a PM-friendly way to get back the "normal"
  15. >> system palette when my last paletted window dies,
  16. >> just as happens when the app quits?
  17. >
  18. >I'm hopeful that someone else will post a more elegant way, but one way
  19. >to do what you want is to detect when you are closing your only window,
  20. >EraseRect it's portRect, and set it's Palette to the system palette,
  21. >*then* close the window.  
  22.  
  23. On the puzzle page in develop #11 (available from ftp.apple.com), Kon &
  24. Bal write: "In 32-Bit QuickDraw David Van Brink extended the Palette
  25. Manager to include a routine called PaletteMgrExit. This routine is
  26. called automatically for you when your application quits, thus restoring
  27. the default color state."
  28.  
  29. Macsbug doesn't know that word, but you might want to try snooping
  30. around (maybe step through ExitToShell, not that I'd like to try it).
  31. Maybe you could shut down and re-init the Palette Manager?
  32.  
  33. Somehow I doubt that using an undocumented trap qualifies as an
  34. "elegant" solution, but I thought I'd pass it along...
  35. -- 
  36.  Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
  37.  The essence of OOP:  "After some hacking, I finally got the program to
  38.  work, but I'm still not sure why." - David Marcovitz (marcovitz@uiuc.edu)
  39.