Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsl!cbnewsk!ech From: ech@cbnewsk.att.com (ned.horvath) Newsgroups: comp.sys.mac.hypercard Subject: Re: Question about protocol for trapping menu items. Message-ID: <1991Jan24.162145.16211@cbnewsk.att.com> Date: 24 Jan 91 16:21:45 GMT References: <48422@apple.Apple.COM> Organization: AT&T Bell Laboratories Lines: 37 In article <1991Jan23.234729.7744@world.std.com> ralph@world.std.com (Ralph Lombreglia) writes: >Why does the following *not* work? >on doMenu what > if what is "Compact Stack" then > close window "MyPalette" > pass doMenu > palette "MyPalette", "345,80" > else pass doMenu >end doMenu From article <48422@apple.Apple.COM>, by jdevoto@Apple.COM (Jeanne A. E. DeVoto): > The reason this doesn't work is that the "pass" keyword halts the current > handler. "Pass" means "forget this handler and just pass the message on > to the next level of the message hierarchy." > > This should work: > > on doMenu theItem > if theItem is "Compact Stack" then > close window "MyPalette" > send "doMenu Compact Stack" to HyperCard -- avoids recursion > palette "MyPalette", "345,80" > else pass doMenu > end doMenu This isn't quite satisfactory: in general, you want to give all the rest of the doMenu handlers in the handler chain a shot at the Compact Stack message. But as far as I know, the only way to refer to "the next handler in the chain" is to pass to it. Why is this reminiscent of "don't tail patch"? =Ned Horvath= ehorvath@attmail.com has to know