home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!psinntp!panix!rmah
- From: rmah@panix.com (Robert Mah)
- Subject: Adding "System" menus
- Message-ID: <1992Dec29.215104.15911@panix.com>
- Date: Tue, 29 Dec 1992 21:51:04 GMT
- Organization: PANIX Public Access Unix, NYC
- Lines: 42
-
- I want to add a menu to the far right of the menu bar (just to the left of
- the balloon help menu). I can patch DrawMenuBar, et. al., however I've
- have another utility, called ColorSwitch that adds it's little icon menu
- just like the system menus (i.e. process and help). I want to do the same.
-
- Disassembling the code, it seemed that ColorSwitch patches GetMenu, and when
- it is caed with a resource ID equal to the balloon help menu, ColorSwitch
- simply inserts it's own menu.
-
- So, I happily went off and did the same thing. One problem it didn't work.
- Upon furthur investigation, I found that after ColorSwitch's call to
- InsertMenu, the menu list (off the global MenuList) was unchanged, while
- after I did it, MenuList was updated! What gives?
-
- I don't understand what is happening because, if I trace, I can see that my
- patch gets called right after ColorSwitch's patch.
-
- Note that ColorSwitch does NOT patch traps like InsertMenu or GetMenuBar,
- etc. It's menu gets inserted by the system, just like the process and
- balloon help menus when the application inserts the apple menu.
-
- Note also that I can insert my menu in the menu bar by fooling directly
- with the menulist data structure, but I recognize that this is A BAD THING,
- and thus want to do things the correct and safe way.
-
- Anyone have any ideas?
-
- BTW, ColorSwitch was written by someone named Andrew Welch, but there was
- no e-mail address in the about info or the docs. Anyone know it?
-
- Cool Runnin'
- Rob
-
-
-
-
-
- --
- [--------------------------------------------------]
- [ Robert S. Mah | "Every day an adventure, ]
- [ rmah@panix.com | every moment a challenge." ]
- [--------------------------------------------------]
-