Class LM_PopupMenu

Parent class: LM_BaseWidget

Version added: before 9.5
The LM_PopupMenu class creates a popup menu widget on the screen. Clicking on this object will bring up the actual menu. To create a new popup menu widget, you would use the LM.GUI.PopupMenu method. See the example below:
SZ_MenuTest.OPTION1 = MOHO.MSG_BASE
SZ_MenuTest.OPTION2 = MOHO.MSG_BASE+1
SZ_MenuTest.OPTION3 = MOHO.MSG_BASE+2

function SZ_MenuTest:DoLayout(moho, layout)
self.menu = LM.GUI.Menu("My Menu")
self.popup = LM.GUI.PopupMenu(120, false)
self.popup:SetMenu(self.menu)
layout:AddChild(self.popup)

self.menu:AddItem("Option 1", 0, self.OPTION1)
self.menu:AddItem("Option 2", 0, self.OPTION2)
self.menu:AddItem("Option 3", 0, self.OPTION3)
end


Image

The LM_Menu of 3 options is attached to the LM_PopupMenu widget

Methods:

Name Returns Description Version added
Menu LM_Menu Returns the menu object attached to the popup menu before 9.5
SetMenu void Use this function to attach a menu to the widget so that when the user clicks on it, the menu appears before 9.5