Parent of submenu

I have a listbox and allow the user to create a contextual menu with a number of entries. 2 of those entries have submenus. Both submenus have list names, one menu adds the listbox row to the selected list and the other removes it.

Is there a way of finding the parent entry of the submenu? I kinda thought a menu item property would have that but don’t see it. I’m already using the tag to hold a key value so don’t want to double up there.


Sadly, while at least the macOS native class NSMenu knows a supermenu property, there is no such thing in Xojo’s class. You have to figure out your own backwards-referencing system.
Because there is no handle property in MenuItem, it also cannot be added easily by simple declares.

You could easily create a class that holds the properties you need and store that as a tag.

Thanks for the replies. There are plenty of ways round it, I just assumed Xojo would tell me what I needed to know but I just couldn’t find it.
I’ll figure something out.