How to manipulate the flyout menu in an InDesign plugin panel

For my InDesign plugin, in the end I actually abandoned altogether trying to manipulate the flyout menu from the uxp side – too little worked as it should, there are too many problems. The solution I adopted was to manipulate the menu entirely from the InDesign side. Doing it that way, you can do everything that you might want to (check/uncheck menu items, disable/enable, insert/remove on the fly, etc.). I wrote about how I have done it here:

Philip