Error getting tags :
error 404Error getting tags :
error 404 popup | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
popup
Basics
Expander triangle
Type
Command
Syntax
popup {stack | button} [at location]
Introduced
1.0
Changed
2.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Displays a popup menu whose menu items are either lines in a button or buttons in a stack.
Examples

popup button "Contextual Menu"
popup stack "Button Properties"
popup stack (field "Which")

Additional Comments
Expander triangle

Use the popup command to display a contextual menu.

Parameters:

The stack is any stack reference. The stack's first card contains a button for each menu item in the popup menu.

The button is a reference to a button on the current card.

The location is an expression that evaluates to a point--two integers separated by a comma.

Comments:

Use the popup command in a mouseDown handler to display the menu.

The popup menu appears with its top left corner at the location. If no location is specified, the menu's top left corner is at the mouse location. While the popup menu is displayed, the handler pauses.

You can use the mouse button parameter of the mouseDown message to specify that the menu should appear only when the user right-clicks (on Unix and Windows systems) or Control-clicks (on Mac OS systems):

on mouseDown theButton

-- pop up the menu on right-click or control-click

if theButton is 3 then popup stack "Lookup Options"

else pass mouseDown

end mouseDown

Choosing a menu item from the popup menu sends a menuPick message to the button (for a button menu) or a mouseUp message to the clicked control in the stack (for a stack menu). The button or stack menu handles the menu choice.

If you use a button to hold the contents of the menu, the button's style property must be set to "menu" and its menuMode must be set to "popup". The button's visible property may be set to either true or false.

Important! The menuMouseButtonproperty of a button used with the popupcommand must be set to zero. Setting it to any other value may result in unexpected behavior when the menu is used. To control which mouse buttons may be used to access the menu, use the mouse buttonparameter of the mouseDownmessage, as described above.

Changes to Revolution:

The option to pop up a button menu was introduced in version 1.1. In previous versions, only stack menus could be used with the popup command.

The location parameter was introduced in version 2.0. In previous versions, the popup menu always appeared with its top left corner at the mouse location.

User Comments
Expander triangle