Back

SetMenu

Hello World

Set the app menu fields.

app.SetMenu( list, iconPath )

When a menu entry is touched, the global OnMenu event will be called.

See Also: ShowMenu

Example - Example

function OnStart()
{
    app.SetMenu( "Start,Stop,Pause" );

    lay = app.CreateLayout( "linear", "" );

    btn = app.CreateButton( "[fa-gear]", -1, -1, "fontawesome" );
    btn.SetOnTouch( app.ShowMenu );
    lay.AddChild( btn );

    app.AddLayout( lay );
}

function OnMenu( item )
{
    app.ShowPopup( item, "Short" );
}
    Copy     Copy All       Run      

Example - Menu Icons

function OnStart()
{
    menus = "Files:folder,Music:list,Images:picture";
    app.SetMenu( menus );

    app.ShowMenu();
}

function OnMenu( item )
{
    app.ShowPopup( item, "Short" );
}
    Copy     Copy All       Run      
string: comma “,” separated
string: path to file or folder ( “/absolute/...” or “relative/...” )