Path: utzoo!attcan!uunet!lll-winken!ames!oliveb!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Why is InsertMenu called with every click in the menubar?? Message-ID: <26389@apple.Apple.COM> Date: 26 Feb 89 00:45:32 GMT References: <41adbdb2.a590@mag.engin.umich.edu> Organization: Apple Computer Inc, Cupertino, CA Lines: 32 In article <41adbdb2.a590@mag.engin.umich.edu> mystone@sol.engin.umich.edu (Dean Yu) writes: > > This may sound like a totally useless question, and I'm probably overlooking >something obvious in the process, but why is InsertMenu being called whenever >there's a mouse down in the menubar? This is being done by the system, >not by the application. If there's an item in the menubar, shouldn't it >have been placed in the menu list by the application already? It just seems >kinda pointless to me... > 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). 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. 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. ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions