That’s great work on the Blender custom menu editor!
I’m thrilled you’re supporting the pie menus in blender as well as linear menus.
I’ve done a lot of work with pie menus, and I appreciate the challenges of trying to make an editor for the circular layout of pie menus, using linear scrolling lists and trees.
Ages ago in another lifetime, I made an implementation of pie menus for ActiveX / OLE, which you could use in Internet Explorer, Visual Basic, and other OLE containers.
It had a rather elaborate set of tabbed property sheets that let you edit and preview them in various ways, but I was never very happy with it, since there is such cognitive dissonance between the automatic circular layout, and the scrolling list / tree controls.
So I made a preview tab that showed how each menu would look, but that was not directly editable via drag-and-drop.
But Simon Schneegans’ Gnome-Pie application launcher has a wonderful drag-and-drop pie menus editor, that you should definitely check out:
But one thing I tried that worked pretty well for both pie and linear menus, up to a point, was editing a tree of nested menus in a regular multi line text editor, as an indented text outline! The ActiveX pie menu demo shows how that works at 7:15. That was an idea by Arthur van Hoff, which he implemented for the HyperTIES user interface builder (which was like HyperCard in NeWS PostScript).
It’s very simple and easy for people to understand and use (nothing to learn since everybody knows how to use a standard text editor and indent text with spaces, and very easy to code), and it takes fewer keystrokes to create and edit a tree of nested menus, than it would take by clicking through tree controls and dialogs.
Its limitation is that it didn’t let you associate properties with each menu item (since there was no way to express it in the text outline, that information could not “round trip” between the text representation and the structural representation).
Of course XML (or JSON but it wasn’t a thing at the time) is the obvious way to represent both text and structure. But then you’re using XML, and nobody wants to edit that directly.
But I think it’s worth considering using simple text outlines in a standard multi line text editor as a way to quickly input and edit the initial tree of menu items.
And if you really wanted to make it possible to edit the menu tree structure in the text editor without losing the formatting and other information on the individual items, you might do something like appending an id tag like “#1" to each line, to associate the text with the metadata (formatting and layout properties, callback, etc). Or maybe you can come up with a better solution, or use a more advanced editor that can handle properties, instead of a standard multi line text editor.
Perhaps you could indent properties below items and prefix them with a dash, or use something like yaml. But I think it would be better to stick to a super simple syntax designed specifically for editing menu trees as much as possible, because yaml is actually quite complicated and quirky and a bit of an overkill (with a lot of the same problems as xml or json).