Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Append menu is slow. Keywords: AppendMenu menu slow efficiency Message-ID: <30414@apple.Apple.COM> Date: 10 May 89 11:52:05 GMT References: <89May9.171757edt.11077@ephemeral.ai.toronto.edu> <29122@ucbvax.BERKELEY.EDU> Organization: Apple Computer Inc, Cupertino, CA Lines: 43 In article <29122@ucbvax.BERKELEY.EDU> oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) writes: >In article <89May9.171757edt.11077@ephemeral.ai.toronto.edu> dudek@ai.toronto.edu (Gregory Dudek) writes: >> I am using AppendMenu to make some big menus and it is slowwwwww (i.e. on >>the order of 5 seconds on a Mac Plus). > >The structure of menus is documented in Inside Mac. Menu items are >basically pascal strings followed by four bytes of extra information. At >the end of the muenu is a null byte. You can use Munger to insert items >into a menu, then call CalcMenuSize() yourself after you are all done. > >If you are really paranoid, you can copy and renumber the current menu >definition procedure and set up your menu to use it. That will guarantee >that if Apple ever changes the format of standard menus, and the MDEF to >run them, that your menus will still work. I think this is over-paranoia >myself. I don't. I think that what you suggest is very bad. Sure, the Menu Manager data structures are documented, but... Inside Mac V, page 228: "WARNING: The MenuList data structure is listed for information only; applications should never access it directly." Inside Mac V, page 230: "WARNING: The MenuInfo data structure is listed for information only; applications should never access it directly. This structure is not a valid Pascal type because of its dynamic size; it's shown for conceptual purposes only." That's enough warning to make _ME_ paranoid. However, there is one other little facet of this whole situation that would make me shiver under my bed. Check out Technote #227: "Toolbox Karma." That's the one that talks about not depending on internal data structures. It's also written by the guy who is working on the Menu Manager... ------------------------------------------------------------------------------ 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