Back

ShowMenu

Hello World
Content:
- Methods

Show a menu on a given control.

smu = MUI.ShowMenu( control, list, width ) → Object

Example - Basic usage

cfg.Light
cfg.MUI

function OnStart()
{
    lay = MUI.CreateLayout("Linear", "VCenter,FillXY")

        btn = MUI.CreateFabOutline("more_vert")
        btn.SetOnTouch(btn_OnTouch)
        lay.AddChild(btn)
    app.AddLayout(lay)
}

function btn_OnTouch() {
    menu = MUI.ShowMenu(this, "Item 1, Item 2, Item 3")
    menu.SetOnSelect(function(item) {
        app.ShowPopup(item)
    })
}
Copy All       Run      

Methods

The following methods are available on the ShowMenu object:

app object
Number: fraction (0..1)
String: separated
function( title )
smu.SetOnSelect
Calls a function when the user selects an item.