This may have worked at one point, but you can no longer do this. The
menu panels that are created when you set the "Contents" of a button
aren't accessible from the scripting language, and aren't saved with
your stack. All you get is a message that you can use to determine
which of the menu items was chosen. The menuPick message is sent to
the button that opened the menu when an item in the menu panel is
chosen and has one argument which is the menu item chosen.
For example, create a button and set the style to "menu" and the menu
mode to either "pulldown" or "option". Then put following into the
contents:
red
green
blue
Then, set the script to:
on menuPick whichcolor
set the backcolor of me to whichcolor
end menuPick
> * Set the MenuName property of the button to the previous pertinent name (using
> the menu property panel of the button).
> * I test, the popup works well.
>
> * Now, I give a script to each of the buttons in the popup menu (the
> automaticaly created stack).
> * I test, none of the scripts are executed!! Here is the problem.
>
> Even if the popUp stack is the toplevel one, none of its button script is
> executed. It's like there were no scripts associated to the popUp stack !
You have to choose whether you're going to create a menu panel stack
separately and set the menuName of the button so that it opens that
stack, or just set the contents of the button and catch the menuPick
message. The first technique, which is used for most of the MetaCard
menus, allows you to put separators and radio and checkbox buttons in
the menu. The latter type is much simpler to construct and manage
since you don't have to create a stack to use as the menu panel.
> Thanks in advance for your help.
>
>
> Laurent Champciaux.
>
> lchamp@info.emn.fr
-- *********************************************************************** * Scott Raney 303-447-3936 Remember: the better you look, * * raney@metacard.com the more you'll see -- Lidia * ***********************************************************************