Displaying Pop-up Menus in Windows

Display a pop-up menu in a window using the PopMenu function to identify the menu and location.

If the menu is currently associated with the window, you can simply call the PopMenu function.

For example, assuming that m_appl is associated with the window, this statement in a CommandButton script displays m_appl.m_help as a pop-up menu at the current pointer position:
m_appl.m_help.PopMenu(PointerX(), PointerY())

If the menu is not already associated with the window, first create an instance of the menu.

For example, assuming that m_new is not already associated with the window containing the script, create an instance of the menu m_new and position mymenu.m_file at the pointer location:
m_new  mymenu
mymenu = create m_new
mymenu.m_file.PopMenu(PointerX(), PointerY())