Class: Toybox::WatchUi::MenuInputDelegate

Inherits:
Lang::Object show all

Overview

MenuInputDelegate responds to a Menu selection.

This class should be extended to handle selected Menu items.

Examples:

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");
        }
    }
}

See Also:

Since:

  • 1.0.0

Instance Method Summary collapse

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Instance Method Details

onMenuItem(item) ⇒ Object

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:

Since:

  • 1.0.0


14196
14197
# File 'Monkeybrains.rb', line 14196

def onMenuItem(item)
end