home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15358 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  3.1 KB

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!taligent!apple!mumbo.apple.com!gallant.apple.com!mtdew.apple.com!alexr
  2. From: alexr@apple.com (Alexander M. Rosenberg)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: popup menus in non-system font
  5. Message-ID: <1992Sep11.171032.18624@gallant.apple.com>
  6. Date: 11 Sep 92 17:10:32 GMT
  7. References: <1992Sep10.214027.7936@dcs.qmw.ac.uk>
  8. Sender: news@gallant.apple.com
  9. Organization: Hackers Anonymous
  10. Lines: 58
  11. X-Useragent: Nuntius v1.1.1d8
  12. X-Xxdate: Fri, 11 Sep 92 18:12:17 GMT
  13. X-Xxmessage-Id: <A6D6218197010C7C@mtdew.apple.com>
  14.  
  15. In article <1992Sep10.214027.7936@dcs.qmw.ac.uk> Jeremy Roussak,
  16. jeremyr@dcs.qmw.ac.uk writes:
  17. >Now, this works a treat. Until, that is, I run an app like
  18. >MSWord (are there any?) or even, I am told, MacWrite IIJ. Then
  19. >(and sometimes for no apparent reason), although the font
  20. >changes for the popup, the size doesn't: it stays at 12 point.
  21. >Checking with MacsBug, SysFontSize is set to 9.
  22. >
  23. >The problem persists after running MSWord, even after quitting
  24. >it. Sometimes it will then go away again, but more often it
  25. >persists until I reboot.
  26.  
  27. This is the result of some _very_ sloppy programming on the parts
  28. of Claris, Microsoft, etc.
  29.  
  30. They have a custom MDEF that draws their cute little up-shift arrow
  31. symbol and the like. MDEFs draw in the Window Manager port. They
  32. change some values in that port and don't restore them.
  33.  
  34. In particular, the text size field is frequently changed to 12.
  35. What was wrong:
  36.  
  37. 1.) They changed the value of a system-wide structure for a specific
  38. purpose and didn't restore it.
  39.  
  40. 1A.) (Only in some applications) Instead of using a trap to change these
  41. values, they slam them directly into the structure, despite years of
  42. Apple recommending otherwise.
  43.  
  44. 2.) They typically set the font to 0 and the size to 12. This is incorrect.
  45. The system font is 0, and the system font size is 0. Size 12 is not correct
  46. for a Kanji system, for one.
  47.  
  48. 3.) Your pop-up is drawn in the Window Manager Port by the sytem supplied
  49. MDEF. You've temporarily changed the system font and size to be the font
  50. and size you want. It ends up being drawn in the correct font at the size
  51. that the application slammed in in step 2, typically 12.
  52.  
  53. What have we learned?
  54.  
  55. 1.) Don't be a bad dog!
  56.  
  57. 2.) Save and restore all system-wide things you change unless the intent
  58. is for the change to affect others.
  59.  
  60. 3.) Listen carefully to the statements that DTS has to say.
  61.  
  62. 4.) Save the current Window Manager port font and size and set them, via
  63. the correct _TextFont and _TextSize traps to 0 around your call to
  64. PopUpMenuSelect.
  65.  
  66. 5.) The pop-up control in System 7 was fixed this way in System 7 Release 7.1.
  67. ---------------------------------------------------------------------------
  68. -  Alexander M. Rosenberg  - INTERNET: alexr@apple.com      - Yoyodyne    -
  69. -  330 Waverley St., Apt B - UUCP:ucbvax!apple!alexr        - Propulsion  -
  70. -  Palo Alto, CA 94301     -                                - Systems     -
  71. -  (415) 329-8463          - Nobody is my employer so       - :-)         -
  72. -  (408) 974-3110          - nobody cares what I say.       -             -
  73.