Newsgroups: comp.sys.mac.programmer Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!peterc From: peterc@sugar.hackercorp.com (Peter Creath) Subject: Re: Symantec's 'Think Reference' (Inside Mac HyperText) Message-ID: <1991Jun9.191950.12688@sugar.hackercorp.com> Summary: pretty nice Organization: Sugar Land Unix -- Houston, TX References: <55825@nigel.ee.udel.edu> Date: Sun, 9 Jun 1991 19:19:50 GMT Think Reference is pretty nice. Although, it only lets you paste the _prototype_ - not the whole code example. I wish they'd let you copy & paste (sans formatting) like Inside Mac DA did. But now on to more fun. In my quest to make Popup menus in fonts other than Chicago 12, I wrote a simple MenuProc and hooked up to it in the manner prescribed by Think Ref. When I didn't alter the MenuProc, I could define multiple menus handling the same MENU resource, but now it crashes on "_HClrRBit". Here's the code, can anybody help? menu=GetMenu(menuID); InsertMenu(menu,-1); DItem=NewHandle(6); /* allocate 6 bytes */ intPtr=(short *)*DItem; /* address those bytes */ *intPtr++=0x4EF9; /* a JMP instruction */ *intPtr++=HiWord(ZingerProc); /* where to jump */ *intPtr=LoWord(ZingerProc); (*menu)->menuProc=DItem; /* attach to MenuInfo */ DItem is a handle, menu is a MenuHandle, *intPtr is short, and ZingerProc is a pascal void procedure. PLEASE respond in E-mail, my news system doesn't allow threading... peterc@sugar.neosoft.com "Listen, there's a hell of a good peterc@sugar.hackercorp.com universe next door. Let's go!" (take your pick) -e e cummings p.s. When I'm done, I'm going to post the source for my popup handler as freeware. --