The documentation says that “PopupMenu.add_submenu_item” should generate an ID, I can’t see any way to get that ID.
I have a popup menu that is procedurally filled, and all have the same submenu but I cant find a way to see which submenu item generated the submenu, none of the signals seem to work.
An id can optionally be provided. If no id is provided, one will be created from the index.
If you don’t provide one then the index of the item will be used. The id is not really necessary to interact with the PopupMenu API as far as I can tell. It’s there for your own code like if you assign an specific id to an item to reference it later.