Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!caen.engin.umich.edu!sol.engin.umich.edu!mystone From: mystone@sol.engin.umich.edu (Dean Yu) Newsgroups: comp.sys.mac.programmer Subject: Re: Why is InsertMenu called with every click in the menubar?? Message-ID: <41b1d71a.a590@mag.engin.umich.edu> Date: 26 Feb 89 01:52:00 GMT References: <41adbdb2.a590@mag.engin.umich.edu> <26389@apple.Apple.COM> Sender: netnews@caen.engin.umich.edu Reply-To: mystone@caen.engin.umich.edu (Dean Yu) Organization: Computer Aided Engineering Network, University of Michigan Lines: 45 Sender: Followup-To: In article <26389@apple.Apple.COM> keith@Apple.COM (Keith Rollin) writes: (Stuff that I said...) >It doesn't have to be anything ominous. It could simply be that the application >you were using was resetting it menus all the time. For instance, one way that >applications can set up a 'Windows' menu is to scan the window list when the >user clicks on that menu, and create the appropriate menu items then. Another >thing that could be happening is that the application is inserting hierarchical >menus only when it needs them (ie, when you click on the menu). It wasn't the application. It was the system calling InsertMenu. > >I tried reproducing your situation, but was unable to. I set up TMON to break >when _InsertMenu was called. I then ran 3 applications (MPW, AppleLink, and >SmartCom). None of these applications broke when I clicked on the menu. I tried it with an A-trap break in MacsBug, and those weren't catching either. Read on! >Finally, how do you know that it is the system that is calling _InsertMenu? Did you write the application, so that you know what is going on? If so, then the >source of the call may be an INIT or something. After setting up TMON, I also >called up OnCue. Sure enough, my Mac broke into TMON 3 times: once for the >main menu, and twice for the 2 hierarchicals I had in it. > I admit it. I was patching InsertMenu. I had placed a call to SysBeep in my patch to make sure my routine was getting called. (This is the first time I've used Get/Set TrapAddress, so I wanted to make sure I was doing it right.) SO my routine was getting called, and it beeped every time I clicked in the menubar. Let me ammend that statement about the ATB's. At first, I had set an ATB for only application calls to the trap. MacsBug didn't break in. I reset it to catch all calls to the trap, and it broke. That's why I think the system is calling InsertMenu. Although I admit it might be an INIT. ______________________________________________________________________________ Dean Yu | E-mail: mystone@caen.engin.umich.edu University of Michigan | Real-mail: Dean Yu Computer Aided Engineering Network | 2413 Kelsey House ===================================| 600 E Madison "These are MY opinions." (My | Ann Arbor, MI 48109 employer doesn't want them. |========================================== Actually, they don't really care | what I think. But President | This space intentionally left blank. Duderstadt does...) | ------------------------------------------------------------------------------