Menu does'nt work

Former Member
Former Member
Hi, i'm using the firmware 2.4.1 for my fenix 5. In my app, i used a menu. I try two ways for instanciate my delegate menu : using function openTheMenu() in the view and function onMenu() in the delegate file. Nothing work ! The sample called 'MenuTest" doesn't work ! Any idear please ?
Thank u.
  • Not sure how you're trying to do this, but have you looked at the menutest sample in the SDK?

    Here's the delegate for that, and you see how onMenu() just pushes the menu:

    using Toybox.WatchUi as Ui;

    class MenuTestDelegate extends Ui.BehaviorDelegate {

    function initialize() {
    BehaviorDelegate.initialize();
    }

    function onMenu() {
    Ui.pushView(new Rez.Menus.MainMenu(), new MenuTestMenuDelegate(), Ui.SLIDE_UP);
    return true;
    }
    }
  • Former Member
    Former Member
    i know that but this code does'nt work on fenix5 simulator and on the fenix5 itself ! The Menu Sample does'nt works.....The "OnMenu" function is never called....
  • I have no problem with the sim or on a real f5 device. How are you trying to trigger onMenu()? It's a long press of the up button.

    in your post you say OnMenu() - is that what you are using? It's a lower case "o" - onMenu()
  • Former Member
    Former Member
    windandkiteDelegate.mc file :

    using Toybox.WatchUi as Ui;
    using Toybox.System as Sys;

    class windandkiteDelegate extends Ui.BehaviorDelegate {

    function initialize() {
    Sys.println( "On windandkiteDelegate:initialize" );
    BehaviorDelegate.initialize();
    }

    function onMenu() {
    Sys.println( "On windandkiteDelegate:OnMenu" );
    Ui.pushView(new Rez.Menus.MainMenu(), new windandkiteMenuDelegate(), Ui.SLIDE_UP);
    return true;
    }

    }


    Menu.xml file :

    <menu id="MainMenu">
    <menu-item id="Item_1" label="@Strings.Reset"></menu-item>
    </menu>


    Strings.xml file :

    <strings>
    <string id="AppName">JumpKite</string>
    <string id="Reset">Reset Score</string>
    </strings>

    windandkitemenuDelegate.mc file :


    using Toybox.WatchUi as Ui;
    using Toybox.System as Sys;

    class windandkiteMenuDelegate extends Ui.MenuInputDelegate {

    function initialize() {
    MenuInputDelegate.initialize();
    }

    function onMenuItem(item) {
    if (item == :Item_1) {
    mMaxAltitude1 = -5000;
    mMaxAltitude2 = -5000;
    mMaxAltitude3 = -5000;
    mDisplayMaxAltitude1 = 0.0;
    mDisplayMaxAltitude2 = 0.0;
    mDisplayMaxAltitude3 = 0.0;
    mMaxHangTime1 = 0;
    mMaxHangTime2 = 0;
    mMaxHangTime3 = 0;

    Sys.println( "RESET OK" );
    }
    }

    }


    windandkiteApp.Mc file :

    // Return the initial view of your application here
    function getInitialView() {
    Sys.println( "On getInitialView" );
    return [ new windandkiteView(), new windandkiteDelegate() ];
    }



    The menu does'nt work with the simulator and with the watch :(

    Samples are not updated for the new SDK :(

    I think that the "onMenu" function is never called when i press the right up button


  • i know that but this code does'nt work on fenix5 simulator and on the fenix5 itself ! The Menu Sample does'nt works.....The "OnMenu" function is never called....


    I'm having no problems with the MenuTest sample provided with the SDK. I tested with both the simulated fenix3 and fenix5 devices.

  • Former Member
    Former Member
    Guys I'm having the same issue with the menu on my Fenix 3 HR.

    I've noticed this behaviour in my app. Where menu is being visible, but onMenuItem is never being called on the real device, by some reason.

    So in order to figure out whats happening, I tried to compile MenuTest from the latest SDK connectiq-sdk-mac-3.0.2 samples folder.

    Both real device (Fenix 3 HR) & simulator: menu items are visible, but not selectable. I cannot select any item. I tried to press UP / DOWN / START buttons - none of these are working. The only working button is BACK.

    I haven't tried any systems other than mac.
  • Former Member
    Former Member
    raveeolee,

    I believe you that this is happening on your machine. However, this doesn't appear to be an issue in the sim:


    This makes me think that there might be something in your code that could be causing this. Would you like for us to take a look at your delegate?

    Thanks,
    -Coleman
  • Former Member
    Former Member
    It is strange. I will try to clean my system and try again. Maybe to install virtual Windows machine and play there as well.

    Regarding the project I'm playing with, it is here:

    https://github.com/raveeolee/garmin_tube_status/tree/newMenu

    Sorry it is my first Garmin project. So the code is a mess atm...

    So this code works for me in the simulator, but not on my real device... Items are not selectable in the menu. I tried logs and looks like onMenuItem is never get called. I am building it with ConnectIQ -> Build for Device Wizard menu.

    Thanks,

    community.garmin.com/.../1401296.gif