Class LM_PopupMenu
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
The LM_Menu of 3 options is attached to the LM_PopupMenu widget
Methods of LM_PopupMenu:
| Name | Returns | Description | Ver |
| Menu Menu() | LM_Menu | Returns the menu object attached to the popup menu | < 9.5 |
| SetMenu SetMenu(menu) | void | Use this function to attach a menu to the widget so that when the user clicks on it, the menu appears | < 9.5 |
Methods inherited from LM_BaseWidget:
| Name | Returns | Description | Ver |
| Redraw Redraw() | void | Call this function to force the widget to redraw itself | < 9.5 |
Methods inherited from LM_View:
| Name | Returns | Description | Ver |
| Enable Enable(enable) | void | Enables or disables a view object | < 9.5 |
| Height Height() | int32 | Returns the height of the widget | 11.0 |
| IsEnabled IsEnabled() | bool | Tells whether the view is currently enabled | < 9.5 |
| IsMouseDragging IsMouseDragging(button) | bool | Verifies if dragging mouse button matches the given argument | 11.0 |
| SetCursor SetCursor(cursor) | void | Change the cursor | < 9.5 |
| SetToolTip SetToolTip(tooltip) | void | Sets the tooltip text for a user interface control | 12.0 |
| Width Width() | int32 | Returns the height of the widget | 11.0 |