home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / programm / 20014 < prev    next >
Encoding:
Text File  |  1992-12-20  |  2.7 KB  |  63 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!usc!cs.utexas.edu!uwm.edu!caen!uvaarpa!concert!samba!usenet
  3. From: Bathsheba.Grossman@launchpad.unc.edu (Bathsheba Grossman)
  4. Subject: Re: Menus with another font than Chcago
  5. Message-ID: <1992Dec18.064817.27264@samba.oit.unc.edu>
  6. Sender: usenet@samba.oit.unc.edu
  7. Nntp-Posting-Host: lambada.oit.unc.edu
  8. Organization: University of North Carolina Extended Bulletin Board Service
  9. References: <5848@krafla.rhi.hi.is> <1992Dec17.223202.13243@dcs.qmw.ac.uk>
  10. Date: Fri, 18 Dec 1992 06:48:17 GMT
  11. Lines: 50
  12.  
  13. In article <1992Dec17.223202.13243@dcs.qmw.ac.uk> jeremyr@dcs.qmw.ac.uk (Jeremy Roussak;Guest of Distributed Systems Lab) writes:
  14. >In <5848@krafla.rhi.hi.is> rson@rhi.hi.is (Mimir Reynisson) writes:
  15. >>How can I let the standard MDEF display it's contents with something
  16. >>other than Chicago? Geneva 9 to be precise? Is it sufficent
  17. >>just to change the system font global variable? and then change it
  18. >>back after PopupSelect?
  19. >
  20. >You have to set the font and size you want into the low-memory
  21. >globals SysFontFam and SysFontSize. Then set LastSPExtra and
  22. >CurFMInput to -1. Finally, save the txSize field of the
  23. >WMgrPort (and, if you have colour QD, the WMgrCPort) and set it
  24. >(them) to zero.
  25. >
  26. >Then PopUpMenuSelect.
  27. >
  28. >Then restore the txSize fields, restore SysFontFam and
  29. >SysFontSize and set LastSPExtra and CurFMInput to -1.
  30.  
  31.  
  32. Is this a joke?  Why not just do it the documented way: when creating the
  33. popup menu, just give it the procID,  popupMenuCDEFProc + popupUseWFont =
  34. 1016.   Then set the window or dialog font to whatever floats your boat. 
  35. IM VI, 3-18.
  36.  
  37. Also, there's been some complaint about the difficulty of writing MDEF's.
  38. I've found that if you're only trying to add a few pretty dingbats,
  39. like MSWord's shift characters, you can bypass the nasty bits by calling
  40. the system MDEF from within your own and then doing the extras on top.  So
  41. something like the following appears in your MDEF:
  42.  
  43. GetResource('MDEF',textMenuProc);    /*get system MDEF*/
  44. savMDEF = (*theMenu)->menuProc;
  45. (*theMenu)->menuProc = sysMDEF;        /*pass message to it*/
  46. if (message == mChooseMsg)    /*store *which because sysMDEF will mung it*/
  47.     whichCopy = *which;
  48.  
  49. CallPascal(message,theMenu,menuRect,hitPt,which,*sysMDEF);
  50. (*theMenu)->menuProc = (Handle)savMDEF;    /*and put me back*/
  51.  
  52.  
  53. Now mSizeMsg can be ignored, you get free balloon help and standard items, and
  54. you need only draw, highlight, and unhighlight your own features.  
  55.  
  56. -Sheba
  57.  
  58. --
  59.    The opinions expressed are not necessarily those of the University of
  60.      North Carolina at Chapel Hill, the Campus Office for Information
  61.         Technology, or the Experimental Bulletin Board Service.
  62.            internet:  laUNChpad.unc.edu or 152.2.22.80
  63.