This post has to do with the MetaTalk's syntax menuPick handlers for
hierarchical menus.  It was going to be a question, but I finally figured
it out for myself.  It took far too long, however, to save someone else
some time, I am posting the simple solution.

Here is a quote from the section on "Buttons Content Menus" of "Concepts
and Techniques" in the on-line documentation:

  You can build hierarchical (also call pull-right or cascading) menus by
  putting tab characters before the name.  The depth of the submenus is
  determined by the number of tabs before the name, with the anchor item
  for a submenu being the line prior to an increase in the number of tabs.
  This means that the first line cannot contain tabs, and that any given
  line can have at most one more tab than the previous line had.

I didn't find any information on the syntax for scripting handlers for such
menus buttons.  Finally I set up a test hierarchical menu with the simple
script

on menuPick which
put which
end menuPick

Reviewing the output that this gave to the message box, I found that the
menuPick message returns the name of the main menuItem, followed by a "|"
character, and the name of the submenu item.  Thus, for example, if the
main menu item "A" brings up a submenu with choices "x", "y", and "z", then
you want to set up a handler of this form:

on menuPick which
switch which
case "A|x"
<do something>
break
case "A|y"
<do something>
break
case "A|z"
<do something>
break
end switch
end menuPick

I tried to find this information in the MetaCard on-line documentation, but
to no avail.  I then checked the discussion list archives at
http://www.mail-archive.com/[email protected]/ .  I thought I had hit
paydirt with a September, 1999 thread with "menuPick" in the subject and
"hierarchical" in the body of several messages.  The person ask a relevant
question, but the discussion digressed into a love fest about the virtues
of MetaCard and ended before an answer was given.

MetaCard is great, but boy, it would sure be better if it had better
documentation.

John Kiltinen



Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to