Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!jkc From: jkc@Apple.COM (John Kevin Calhoun) Newsgroups: comp.sys.mac.hypercard Subject: Re: HyperCard 2.0 Bug: SendHCEvent Message-ID: <48365@apple.Apple.COM> Date: 22 Jan 91 22:05:07 GMT References: <1991Jan22.153802.22992@wam.umd.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 42 In article <1991Jan22.153802.22992@wam.umd.edu> scott@wam.umd.edu (John Lynwood Scott) writes: > > A while ago, somebody suggested using the SendHCEvent callback to >maintain HyperCard functionality while still retaining control in an XCMD. >I would like to do just that, but I have run into a snag. > > I wrote a short XCMD that >simply waits for events and passes them back to HyperCard. Everything >seems to work okay: moving the mouse off the HyperCard window changes the >cursor, menus can be pulled down and commands selected, etc. But Command >Keys will not work. > > My questions are: is this bug corrected in HyperCard 2.0v2 and, >if not, is there a work around? This is a bug in HyperCard. It's not fixed in 2.0v2. I don't recommend using SendHCEvent for this purpose even after we fix the bug. SendHCEvent was implemented for use by XCMDs that absolutely have to call GetNextEvent or WaitNextEvent, in order to inform HyperCard of update events and app4events as they occur. If it's at all possible to avoid calling GNE in an XCMD, you should avoid it. HyperCard needs idle time in order to keep its environment clean. > I realize >that I could create an xWindow which I could keep invisible, and request >a lot of idles from HyperCard to handle incoming chars from the Comm >Toolbox. It's much better to use the "invisible window" approach. In fact, I know of one developer who used this approach to his benefit. "I've got to have a window in order to do this," he said, "so I might as well use it." He's implemented some very helpful configuration controls in his window, although they weren't part of his original design. They turned out to be very valuable features. Kevin Calhoun HyperCard Team Apple Computer, Inc.