Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uwvax!astroatc!nicmad!madnix!jason From: jason@madnix.UUCP (Jason Blochowiak) Newsgroups: comp.sys.apple Subject: Re: About Carpet Bag Summary: Jason picks a programming legality nit Keywords: NDA, hacks, InstallNDA, //gs, programming Message-ID: <1110@madnix.UUCP> Date: 14 Feb 90 14:27:46 GMT References: <113300273@uxa.cso.uiuc.edu> Reply-To: jason@madnix.UUCP (Jason Blochowiak) Organization: ARP Software, Madison, WI Lines: 61 wombat@claris.com (Scott Lindsey) writes: >Here's a possible workaround the InstallNDA problem under 5.0.2. It appears >to work for me; maybe Dave or someone else at DTS will comment on its >cleanliness. Without going into the details of loading the file or figuring >out which file to load... Well, I definitely don't work for DTS, but... > i = GetNumNDAs(); > for (;i;i--) > DeleteMItem(i); > CalcMenuSize(0,0,1); > InstallNDA(whatever); > FixAppleMenu(1); > CalcMenuSize(0,0,1); The FixAppleMenu(1) is seriously questionable - as has been mentioned somewhere, the Apple menu may very well not have an ID of 1. I didn't see any warning labels on the menu bar structure, so how's about getting the ID by doing (both of these assume that the menu structures are publicly defined and that GetSysBar is properly typed in the interface file): menubar = GetSysBar(); menu = (**menubar).menuList[0]; id = (**menu).menuID; or, in more fun C: id = (**((**(GetSysBar())).menuList[0])).menuID; Still not great, but a bit less assumptive. It, however, does assume that the NDAs were added to the first menu. Anyways, my version of the code: i = GetNumNDAs(); InstallNDA(FindHandle(part of result rec from InitialLoad)); /* Error handling here - not altogether necessary, but nice */ for (i = GetNumNDAs();i;i--) DeleteMItem(i); id = (**((**(GetSysBar())).menuList[0])).menuID; FixAppleMenu(id); CalcMenuSize(0,0,id); It seemed that the first of the CalcMenuSize's was superfluous. I may very well be wrong about that one, tho'. Anyways, all of this could still cause problems with applications that do things legally, but a little bit wierd. For example, an application could add something after the NDA's in the Apple menu. It would still be there, but it'd be above the NDA's (guess that's not a good example. oh, well). >Scott Lindsey | I dig iguana in their outer space duds >Claris Corp. | saying, "Aren't you glad we only eat bugs?" >ames!claris!wombat| DISCLAIMER: These are not the opinions of Claris, Apple, >wombat@claris.com | StyleWare, the author, or anyone else living or Dead. -- Jason Blochowiak - jason@madnix.UUCP or, try: astroatc!nicmad!madnix!jason@spool.cs.wisc.edu "Education, like neurosis, begins at home." - Milton R. Saperstein