Menu2 assit

Hello,

I am trying to figure out how to do on watch Menus.  It’s gotten the better of me for a while now.  So…I tried to extract how to do a menu based on ComplexFW (thanks again JM).  The only thing I want it to do is display a time and use an on-watch menu to determine if it displays 24 hour or 12 hour time.

The watch face runs until I select “trigger app settings” in the simulator.  Then, nothing happens until about 5 seconds later when the whole thing crashes.  There are no errors listed in the Problems, Debug console, or Terminal.  It just shows the garmin triangle and stops running.

I’ve posted the entire (short?) program here: https://github.com/FlyFrosty/MyMenu

Any help would be appreciated

Jeff

  • My last planned post on this.  Thanks for you for your help along the way.

    I have a very basic menu clock face located here...

    https://github.com/FlyFrosty/MenuExample2

    It ONLY displays the time and provides an on-watch menu choice of selecting red or blue color font.  I know for most of you, this is pointless, but it might help another novice like me better understand how things relate (the delegates drove me crazy for some reason) and are implemented. 

    Thanks again,

    Jeff

  • Horrible code. This is why we can't use ChatGPT, because it learns on things like this.

  • provides an on-watch menu choice of selecting red or blue color font.

    I know this is just an example, but your code shows the following menu directly on triggering on-device settings:

    This is obviously not extensible if you (or someone using this example) need to have more settings other than the color.

    The suggested idea was more like this:

  • So…user friendly menu? Sounds reasonable. Thanks.  I will work on a menu with sub-menus version (baby steps) next.

    I know I said I was done with this, but...

    The function onBack() appears to call onUpdate().  However, after I select an item on my watch (not the simulator), if I select the back button it crashes (I have to swipe off the screen and back to get it to recover).  If I tap the watch face after a menu change, it loads up just fine.  Is there a difference between how Garmin exits? Oh great sharers of knowledge, what am I missing?

    Jeff

  •  However, after I select an item on my watch (not the simulator), if I select the back button it crashes

    [In a previous version of this comment, I said something about returning true or false in onBack. This is not relevant for Menu2InputDelegate .onBack() which ofc returns nothing.

    In another version of this comment, I also said not to call popView in onBack, which was also incorrect. You do have to call popView if onBack is overridden, as per the docs. So that code seems fine to me.

    Sorry for the misinfo]

    Looking more closely at your code, onSelect() calls onBack() when an item is selected, so the real question is why isn't the app settings view completely exited at this point (why is the user able to press back to cause a crash here).

    I tried your code on a real FR955 and I don't see the problem you've described. I don't see any obvious problem in the code that would cause this either.

    On a real FR955, I tested as follows:

    - sideloaded your watchface

    - from the watchface, held UP for settings, selected Watch Face (which displays the current watchface and allows you to select a different one), pressed START for the context-sensitive action menu (popover menu that that's displayed on the right side of the screen), and selected Customize to open on-device settings (yes this is a ridiculous number of steps)

    - at this point, your menu is displayed. Whether I select a menu item or I press BACK, the menu / on-device settings is exited cleanly, and I'm returned to the action menu. At this point, everything works fine. I can go back to the watchface by pressing BACK twice (once to close the action menu, once to exit the watchface selection UI) ad there's no crash.

    Oh great sharers of knowledge, what am I missing?

    Don't expect any more help from me on this topic. Try asking the zero other people who put in a significant amount of time and effort attempting to help by running your code and trying to answer your specific questions.

    Good luck with your watchface

  • I am actually trying out the menu system on one of my watch faces.  I apologize for not stating that.  I uploaded the source code here...

    https://github.com/FlyFrosty/AviationTime

    (yes the code still needs a clean-up and some error checking…)

    Jeff