Say we have a MenuItem with three selectable options in it, constructed like so:
Category:
Option 1
Option 2:
SubOption 1
SubOption 2
and we want a string array representation of this that looks like so:
item(0) Category: Option 1
item(1) Category: Option 2: SubOption 1
item(2) Category: Option 2: SubOption 2
and we want to get a corresponding array of tags from the menu also, like so:
tag(0) … the tag for the MenuItem corresponding to item(0) above
tag(1) … the tag for the MenuItem corresponding to item(1) above
tag(2) … the tag for the MenuItem corresponding to item(2) above
For some reason I can’t figure out how to do this. I’ve done similar things for file hierarchies, but folderitems are quite different to work with. It seems trying to write a recursive algorithm fails here. I’ve written a couple of methods a few times and I’m getting nowhere. It needs to be generalised to be able to return strings and tags for any menu. Any ideas?
EDIT: said another way, what I’m after for the string part is the equivalent of a file path, but for a MenuItem … a “MenuPath” if you will.