Command group Flag affected Reversible Execute on client Platform(s)
Menus YES NO NO All

Syntax

Popup menu menu-name ([x-coordinate,y-coordinate,menu-constructor-parameters])

Description

This command installs the specified menu as a popup menu at the specified location. The location is the x,y screen coordinate relative to the (0,0) position. Under Windows, the coordinate (0,0) is the point directly under the menu bar within the Omnis application window. Under Linux and macOS, (0,0) is literally the top left corner of the screen. If you omit the x,y coordinates the menu pops up at the current mouse/pointer position.

The mouseover() function returns the mouse/pointer position relative to the open window and not the Omnis application window. Using this function to specify the x and y position of the popup menu may not produce the effect you want.

Popup menu behaves much like Popup menu from list except the source of the popup is a user-defined menu. It clears the flag if the user does not select a menu line, otherwise, the line selected from the popup is executed.

If desired, you can supply parameters after the x and y coordinates. The command passes these parameters to the constructor of the user-defined menu instance. When passing constructor parameters, leave the x and y coordinate parameters as either empty or #NULL to popup the menu in the current mouse position.

Example

# Prevent the default context menu appearing and open the menu mView instead
# $event of object on window class
On evRMouseDown ## requires the property $rmouseevents set to kTrue
  Process event and continue (Discard event)
  Popup menu mView