I am able to dynamically load them into a menu, but can't fathom how to determine which one they've selected.
The onMenuItem(Item) faithfully returns the symbol, but I can't see a way to dynamically generate the item's id when loading the menu.
The web site returns a JSON array of dictionaries in loadedMarks which I use to build the menu:
var marksMenu=new Menu();
for (var i = 0; i < loadedMarks.size(); i++) {
marksMenu.addItem(loadedMarks["name"],:selected);
}
Ui.pushView(marksMenu, new MenuTestMenuDelegate(), Ui.SLIDE_UP);
[/code]
This of course doesn't work because it allocates the same id (symbol :selected) to each item. I'm looking for a way to identify which item he selected in my onMenuItem(Item) callback.
I note that the spec says "...This class should be extended to get the chosen Menu item." and wonder if the documentation guy had my problem in mind!
I also noted somewhere in the programmers guide that menus should not be created programatically, but what else is a poor boy to do?