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

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!gatech!hubcap!opusc!usceast!walkerj
  3. From: walkerj@math.scarolina.edu (Jim Walker)
  4. Subject: Re: popup menus in non-system font
  5. Message-ID: <walkerj.716184884@milo.math.scarolina.edu>
  6. Sender: usenet@usceast.cs.scarolina.edu (USENET News System)
  7. Organization: USC  Department of Computer Science
  8. References: <1992Sep10.214027.7936@dcs.qmw.ac.uk>
  9. Date: 11 Sep 92 04:14:44 GMT
  10. Lines: 59
  11.  
  12. In <1992Sep10.214027.7936@dcs.qmw.ac.uk> jeremyr@dcs.qmw.ac.uk (Jeremy Roussak) writes:
  13.  
  14. >I want a popup menu to appear in a non-system font and size.
  15. >There's something about this in the Q&A stack, so I followed
  16. >Apple's advice. My code looks like this:
  17.  
  18. >SysFontFam = (*v.options)->menuFont;
  19. >SysFontSize = (*v.options)->menuSize;
  20. >LastSPExtra = CurFMInput = -1;
  21.  
  22. >then PopUpMenuSelect, then reset SysFontFam and SysFontSize and
  23. >invalidate the other two globals again.
  24.  
  25. >Now, this works a treat. Until, that is, I run an app like
  26. >MSWord (are there any?) or even, I am told, MacWrite IIJ. Then
  27. >(and sometimes for no apparent reason), although the font
  28. >changes for the popup, the size doesn't: it stays at 12 point.
  29. >Checking with MacsBug, SysFontSize is set to 9.
  30.  
  31. >The problem persists after running MSWord, even after quitting
  32. >it. Sometimes it will then go away again, but more often it
  33. >persists until I reboot.
  34.  
  35. Here's an answer, archived from CompuServe:
  36.  
  37. |Date:    Wed, Aug 19, 1992 11:32:27 AM
  38. |Subject: #95335-PopUpMenuSelect + style
  39. |From:    Spec Bowers 70731,3710
  40. |To:      Ken Elston 71251,310
  41. |
  42. |
  43. |Ken,
  44. |
  45. |It's a bug in several Microsoft products. You can program around it but it's a
  46. |nuisance.
  47. |
  48. |The Window Manager's port is normally set to size 0, system standard.
  49. |Microsoft comes along and sets it to size 12 and doesn't restore it.
  50. |
  51. |The technique described in previous messages for setting font and size for a
  52. |popup menu, simply sets the system standard. Whenever a port is using size 0,
  53. |it uses the standard size stored in the low memory globals. If the port is set
  54. |to 12 or any other size, the default size is ignored.
  55. |
  56. |The cure is to set the window manager's port (WMGRPort) to size 0 before
  57. |calling PopupMenuSelect. You'll have to save the current port, get the WMGR
  58. |port, set the current port to be the WMGR port, set the size to 0, then
  59. |restore the current port to the original. You probably should reverse the
  60. |process after PopupMenuSelect returns. It is proper practice to restore port
  61. |settings. On the other hand the proper setting for the WMGR port is 0.
  62. |
  63. |
  64. |Spec Bowers
  65. |Bowers Development
  66. |(developers of AppMaker)
  67.  
  68. --
  69.  
  70.  -- Jim Walker  USC Dept. of Math.  walkerj@math.scarolina.edu
  71.