How do I populate menu icons for Montana 7?

How do I populate menu icons for Montana 7?

EDIT: Menu2 does not appear to do what I want. Menu2 appears to just create a second level of menu items for when you press the menu button. What I'm looking for is to add icon/buttons to the menu bar as circled below in red.

-------

I see the icons for the back button and main menu, which seem to be built into the API. I tried Menu2, but I get the following message:

ERROR: montana7xx: C:\test.mc: Undefined symbol "MyMenu2Delegate" detected.
WARNING: montana7xx: C:\test.mc:11: Unable to detect scope 'MenuItem' for the symbol 'initialize'.
WARNING: montana7xx: C:\test.mc:19: Unable to detect scope 'MenuItem' for the symbol 'initialize'.
WARNING: montana7xx: C:\test.mc:27: Unable to detect scope 'MyMenu2Delegate' for the symbol 'initialize'. 

which leads me to believe that menu2 is not available on the Montana 7, or I'm doing it wrong....

Any ideas?

  • I think your problem is a missing declaration for MyMenu2Delegate. Typo maybe?

  • You were right. I needed to just create a custom delegate for Menu2InputDelegate:

    import Toybox.Lang;
    import Toybox.System;
    import Toybox.WatchUi;
    
    class Menu2Delegate extends WatchUi.Menu2InputDelegate {
    
        function initialize() {
            Menu2InputDelegate.initialize();
        }
    
        function onMenuItem(item as Symbol) as Void {
            ...
        }
    
    }

    Unfortunately this isn't the behavior I was looking for. Menu2 appears to just be a second Menu that appears if you press the menu button a second time.

    How do I add icon buttons to the bar at the bottom?

  • You can't.  The button bar on devices is drawn after your onUpdate() completes, and isn't even part of your dc.  What you can do is draw your own button within the dc, like this:

    Here's menu2 on the montana:

    What you can do is once you push the first menu is push a second menu based on what's selected.

  • Thanks, Jim. That's a bummer. I hope Garmin opens up the ability to create cutom buttons on later version of the API...it would be very useful.