home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20413 < prev    next >
Encoding:
Text File  |  1992-12-29  |  1.9 KB  |  52 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!psinntp!panix!rmah
  3. From: rmah@panix.com (Robert Mah)
  4. Subject: Adding "System" menus
  5. Message-ID: <1992Dec29.215104.15911@panix.com>
  6. Date: Tue, 29 Dec 1992 21:51:04 GMT
  7. Organization: PANIX Public Access Unix, NYC
  8. Lines: 42
  9.  
  10. I want to add a menu to the far right of the menu bar (just to the left of
  11. the balloon help menu).  I can patch DrawMenuBar, et. al., however I've 
  12. have another utility, called ColorSwitch that adds it's little icon menu 
  13. just like the system menus (i.e. process and help).  I want to do the same.
  14.  
  15. Disassembling the code, it seemed that ColorSwitch patches GetMenu, and when
  16. it is caed with a resource ID equal to the balloon help menu, ColorSwitch
  17. simply inserts it's own menu.
  18.  
  19. So, I happily went off and did the same thing.  One problem it didn't work.
  20. Upon furthur investigation, I found that after ColorSwitch's call to 
  21. InsertMenu, the menu list (off the global MenuList) was unchanged, while
  22. after I did it, MenuList was updated!  What gives?
  23.  
  24. I don't understand what is happening because, if I trace, I can see that my
  25. patch gets called right after ColorSwitch's patch.
  26.  
  27. Note that ColorSwitch does NOT patch traps like InsertMenu or GetMenuBar, 
  28. etc.  It's menu gets inserted by the system, just like the process and 
  29. balloon help menus when the application inserts the apple menu.
  30.  
  31. Note also that I can insert my menu in the menu bar by fooling directly
  32. with the menulist data structure, but I recognize that this is A BAD THING,
  33. and thus want to do things the correct and safe way.
  34.  
  35. Anyone have any ideas?
  36.  
  37. BTW, ColorSwitch was written by someone named Andrew Welch, but there was
  38. no e-mail address in the about info or the docs.  Anyone know it?
  39.  
  40. Cool Runnin'
  41. Rob
  42.  
  43.  
  44.  
  45.  
  46.  
  47. -- 
  48. [--------------------------------------------------]
  49. [  Robert S. Mah   |  "Every day an adventure,     ]
  50. [  rmah@panix.com  |   every moment a challenge."  ]
  51. [--------------------------------------------------]
  52.