menuButton

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the menuButton
menuButton()
Synonymsmenuobject
Summary

Returns the name of the button that triggered display of a stack menu.

Introduced1.0
OSmac, windows, linux
Platformsdesktop, server
Example
the menuButton
hide the menuButton
Values
NameTypeDescription
return

The menuButton function returns the name property of the button. You create a stack menu by laying out the menu items as buttons in a stack window, then setting the menuName property of a button in another stack to the menu stack's name. Clicking the button displays the menu stack as a menu. If you use the same stack menu as the menuName of more than one button, the menuButton tells you which button the user clicked to display the stack menu.

For example, suppose you create a stack menu listing all your mailboxes, and display it when clicking both a "Delete" button and an "Open" button. Checking the menuButton from within the stack menu lets you respond appropriately to the user's choosing a mailbox, either deleting it or opening it.

RelatedKeyword: me, menu, button
Property: menuHistory, menuMouseButton, name, menuName
Command: option
Object: stack
Glossary: handler, stack menu, property, trigger, return
Control Structure: function
Description

Use the menuButton function within a handler in a stack menu to determine which button opened the menu.

Tagsmenus