Class: Toybox.WatchUi.Menu

Toybox.Lang.Object show all


A representation of an on-screen menu.

A Menu is a special View that presents the user with a list of options. After an option is selected, the registered onMenuItem() method will be called. While a Menu can be generated programmatically, they should generally be created as a resource.

A Menu is pushed using pushView(), which provides a MenuInputDelegate as the input delegate.

See Also:


The look and feel of a menu is device-specific.


Build a simple menu programmatically

using Toybox.WatchUi;

class MyBehaviorDelegate extends WatchUi.BehaviorDelegate {
    function initialize() {

    function onMenu() {
        var menu = new WatchUi.Menu();
        var delegate;
        menu.setTitle("My Menu");
        menu.addItem("Item One", :one);
        menu.addItem("Item Two", :two);
        delegate = new MyMenuDelegate(); // a WatchUi.MenuInputDelegate
        WatchUi.pushView(menu, delegate, WatchUi.SLIDE_IMMEDIATE);
        return true;


API Level 1.0.0

Constant Summary

Constant Variables

Type Name Value Since Description
Type MAX_SIZE 16

API Level 1.0.0

The maximum number of allowed entries in a Menu.

Instance Method Summary collapse

Instance Method Details

addItem(name as Lang.String or Lang.Symbol, identifier as Lang.Symbol) as Void

Add an entry to a Menu.


  • name(Lang.String)

    The item text or the resource identifier of a string resource

  • identifier(Lang.Symbol)

    A Symbol representing the Menu item value


API Level 1.0.0

setTitle(title as Lang.String or Lang.Symbol) as Void

Set a Menu title.


  • title(Lang.String)

    The title text or the resource identifier of a string resource


API Level 1.0.0

Generated May 31, 2023 8:48:51 AM