Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!usc!ucsd!hub!6500stom From: 6500stom@hub.UUCP Newsgroups: comp.sys.mac.programmer Subject: Re: GetMenu danger?? Message-ID: <3381@hub.UUCP> Date: 20 Dec 89 19:01:52 GMT Sender: news@hub.UUCP Lines: 25 From article <89353.093306DN5@PSUVM.BITNET>, by DN5@PSUVM.BITNET: > I am writing a HyperCard XCMD to use popup menus from resources > (I didn't like the idea of creating the data structures each and > every time I invoked the thing). I pass the menu id to the XCMD, > and then I do a GetMenu on the id, then go through that menu looking > for submenus, and call GetMenu on them. > > In Inside Mac I, it claims that GetMenu should never be called more than > once for a menu. Yet I have to call GetMenu each time I invoke this > XCMD; however, I do a DeleteMenu for each menu I call GetMenu for. "(For menus read from a resource file with GetMenu, use ...Release- Resource instead [of DisposeMenu]" (I-352) Which means that if you want to torch a menu from the menu bar and memory you have to first DeleteMenu and then ReleaseResource (in your case). The Menu Mgr is usually pretty flexible but I couldn't get Get/Set- ItemCmd to work for me using normal command keys. I suspect they only work for hier-menus but maybe I'm holucinating. I found a work around anyway (no need to reply). / Josh Pritikin T Ignorance is bliss. \ | Internet: 6500stom@ucsbuxa.ucsb.edu | I must be in hell. | | AppleLink: Josh.P | My room is proof that entropi | \ GEnie: J.Pritikin ! exists. /