Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!apple!jdevoto From: jdevoto@Apple.COM (Jeanne A. E. DeVoto) Newsgroups: comp.sys.mac.hypercard Subject: Re: Question about protocol for trapping menu items. Summary: pass aborts the current handler Keywords: domenu, compact, trap Message-ID: <48422@apple.Apple.COM> Date: 24 Jan 91 06:29:50 GMT References: <1991Jan23.234729.7744@world.std.com> Organization: Apple Computer Inc., Cupertino, CA Lines: 32 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 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 -- ========= jeanne a. e. devoto ======================================== jdevoto@apple.com | You may not distribute this article under a jdevoto@well.sf.ca.us | compilation copyright without my permission. ______________________________________________________________________ Apple Computer and I are not authorized | CI$: 72411,165 to speak for each other. |