SO many bugs !
it is really hard to follow any example provided in the official SDK docs ! its really disappointing when even the examples dont even compile and you have to go through rabbit holes and then more rabbit holes, because nothing really works
The examples listed here:
Garmin/ConnectIQ/Sdks/connectiq-sdk-mac-6.4.0-2023-11-15-2e7aa9074/PersonalityLibrary.html#actionmenuhint
from the actual page
Example
menu.xml
<action-menu id="ActionMenu">
<action-menu-item id="edit" label="@Strings.edit" />
<action-menu-item id="dismiss" label="@Strings.dismiss" />
</action-menu>
InputDelegate.mc function onKey(evt as KeyEvent) as Boolean { if (Styles.input_system__action_menu has :button && evt.getKey() == Styles.input_system__action_menu.button) { showActionMenu(); return true; } return false; } function onTap(evt as ClickEvent) as Boolean { if (!(Styles.input_system__action_menu has :button) && $.isInActionArea(evt.getCoordinates())) { showActionMenu(); return true; } return false; } function showActionMenu() as Void{ WatchUi.showActionMenu(new Rez.Menus.Menu(), new MyActionMenuDelegate()); }
Cant even compile ! why ?
1. Compilation error "Undefined symbol ':input_system__action_menu' detected.". And yes, when trying it out, i did import Rez.Styles module
How did the person writing this tutorial https://forums.garmin.com/developer/connect-iq/b/news-announcements/posts/adding-a-touch-of-personality-with-personality-ui
compile there code is beyond me
"Let’s look at this function. The Personality UI selectors we used in the resource XML earlier are accessible in the Monkey C code space via the Rez.Styles module. In this case, we are checking to see if the system_input__action_menu selector has the button symbol, and we’re referencing it if it does."
How ??
2.
Toybox.WatchUi.showActionMenu expects input Toybox.WatchUi.ActionMenu and not Rez.Menus.Menu
Ref: https://developer.garmin.com/connect-iq/api-docs/Toybox/WatchUi.html#showActionMenu-instance_function