gui.popMenu

Shows or hides a popup menu.

Prototype

  1. bOk = gui.popMenu ( hMenu, bShow, [nGlobalPositionX=nil, nnGlobalPositionY=nil] )

Description

Shows or hides a popup menu, for instance a right-click context menu.


Parameters

hMenu - menu handle
bShow - true to show, false to hide
nGlobalPositionX, nGlobalPositionY - optional menu position on the screen in px, default nil means mouse pointer position


Return values

bOk - true on success


Sample

  1. function onPropertyViewSectionAIModelsItemRightClicked ( hView, hComponent )
  2.  
  3. local hMenu = gui.getComponent ( "genericContextMenu" )
  4. if ( hMenu ) then
  5. -- fill it with items
  6. -- and when done, pop the menu
  7. gui.popMenu ( hMenu, true )
  8. -- etc
  9.  

Available since ShiVa 2.0