home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!yale.edu!jvnc.net!netnews.upenn.edu!eniac.seas.upenn.edu!gasser
- From: gasser@eniac.seas.upenn.edu (Nathan Gasser)
- Newsgroups: comp.sys.mac.hypercard
- Subject: Re: Menu Question
- Message-ID: <103422@netnews.upenn.edu>
- Date: 30 Dec 92 20:36:50 GMT
- Sender: news@netnews.upenn.edu
- Lines: 44
- Nntp-Posting-Host: eniac.seas.upenn.edu
-
- >> I have made my own menus in the menubar and I was wondering
- >> how to enable them.
-
- >you have to write a "domenu" handler
- >on domenu What
- > if what = "your menuitem" then
- > your commands
- > exit domenu
- > end if
- > if what = "Your next menuitem" then
- > your commands
- > exit domenu
- > end if
- > pass domenu
- >end domenu
- [...]
- >it is also possible to use menuMessage when you create the menu, but
- >I think that domenu is easier if you do it for the first time.
-
-
- I really think the menuMessage approach is a thousand times better,
- and it's not hard at all:
-
- on menuInstall
- if there is a menu "Jokes" then delete menu "Jokes"
- create menu "Jokes"
- put "Knock-Knock" into menu "Jokes" with menuMessage "doKnock"
- put "Limericks" after menu "Jokes" with menuMessage "doLimerick"
- put "Light Bulb" after menu "Jokes" with menuMessage "doBulb"
- [...]
- end menuInstall
-
- Then when someone chooses a menu item, the cooresponding menuMessage
- handler is issued. You can only have a 1 line command for each menu item,
- though. Just make handlers to do what you want for each item.
-
- Trapping doMenu is no fun, nor is a mile-long if-then-else.
-
- Nate.
- --
-
- Nathan Gasser ><>
- gasser@eniac.seas.upenn.edu
-
-