Hierarchical menu bug
David Epstein
depstein at att.net
Mon Dec 3 20:07:01 EST 2001
After a menu has been used, its "menuhistory" property should report the
line number of what was selected. This does not work properly if the menu
is hierarchical, i.e., includes tab-indented lines. The parameter passed by
menuPick reports the contents of what was selected (although even this does
not work properly if the button style is "option"); but this information
cannot reliably indicate which selection was made if, for example, the same
content appears more than once in the menu. Is there some other property
that will report the choice by number, or is this a bug than can be fixed?
Details: On an iMac under System 9:
Create a button with this script:
on menuPick what
put the menuHistory of me && what
end menuPick
And make the contents of the menu something like this (use tab characters to
indent the subsets):
Meat
beef
chicken
lamb
Fish
flounder
halibut
trout
Vegetables
broccoli
The result of using this button depends on the style of the button. If we
choose "lamb", which is entry 3 of category 1 ("meat"), and is in line 4 of
the overall menu content...
When the button style is set to popup:
--menuHistory = "3" -- lamb's position within the category.
--menuPick parameter = Meat|lamb
When the button style is set to pulldown:
--menuHistory is unresponsive (holds prior value)
--menuPick parameter = Meat|lamb
When the button style is set to option:
--menuHistory = "3" -- lamb's position within the category.
--menuPick parameter = Vegetables -- [!] -- i.e., it reports the nth
category name, where n = the entry number within its own category of what
was selected.
Does some other property report the "category number" that menuHistory's "3"
refers to? What would be simpler is some property that returned the value
"4" in this case, since that has an unambiguous meaning in relation to the
content of the button (and in relation to whatever that content was derived
from). Is there some such property?
Many thanks.
David Epstein
More information about the metacard
mailing list