Class: Toybox.WatchUi.TextPickerDelegate


TextPickerDelegate responds to a TextPicker selection.

This class should be extended to handle the specified text.

See Also:


using Toybox.WatchUi;

// A string to display on the screen
var screenMessage = "Press Menu to Enter Text";
var lastText = "";

class MyTextPickerDelegate extends WatchUi.TextPickerDelegate {

    function initialize() {

    function onTextEntered(text, changed) {
        screenMessage = text + "\n" + "Changed: " + changed;
        lastText = text;

    function onCancel() {
        screenMessage = "Canceled";


API Level 1.1.0

Supported Devices:

Instance Method Summary collapse

Instance Method Details

onCancel() as Lang.Boolean

Text entry has been canceled.


API Level 1.1.0

onTextEntered(text as Lang.String, changed as Lang.Boolean) as Lang.Boolean

A text string was entered into a TextPicker.

This method is called when text has been specified by a TextPicker, and receives the text String as an argument.


  • text(Lang.String)

    The entered text

  • changed(Lang.Boolean)

    The entered text differs from the initially specified text of the TextPicker


API Level 1.1.0

Generated Jun 6, 2024 10:31:54 AM