Class: Toybox.WatchUi.MenuInputDelegate

Overview

MenuInputDelegate responds to a Menu selection.

This class should be extended to handle selected Menu items.

See Also:

Example:

using Toybox.WatchUi;
using Toybox.System;

class MyMenuInputDelegate extends WatchUi.MenuInputDelegate {
    function initialize() {
        MenuInputDelegate.initialize();
    }

    function onMenuItem(item) {
        if (item == :item_1) {
            System.println("Item 1");
        } else if (item == :item_2) {
            System.println("Item 2");
        }
    }
}

Since:

API Level 1.0.0

Instance Method Summary collapse

Instance Method Details

onMenuItem(item as Lang.Symbol) as Void

A Menu item was chosen.

This method is called when a Menu item has been selected, and receives the Menu item as an argument.

Parameters:

  • item(Lang.Symbol)

    The identifier of the chosen Menu item

Since:

API Level 1.0.0


Generated Sep 23, 2024, 3:32:49 PM