I don't think this doable right now, if it is, please point me in the right direction.
The idea would be to be able to build dynamic custom menu buttons through scripting, e.g. a script command that, once put in a menu and called, would build the content of the menu (commands, sub-menus, ...).
This would require a new property to the script Func
property (menu_items
?) which could be built dynamically with (at least) either buttons
or menus
(a menu could then include itself buttons or menus ...).
A button would have some properties like icon
, label
and command
, menus would probably not have the command
(unless it's possible to build MenuButtons
).
That pattern could be extended to fit the principle of the built-in existing dynamic buttons (tab group list, drive list, ...). It could be a property of the "menu" to be displayed as a menu or as a dynamic button or act differently if put in a button or in a menu.
So far, the next best thing that I think is doable, is what has been shared by @galaxyhub in this post where you build a menu from standard dialog, but it misses the standard look & feel of menu, does not offer icon for the commands, and don't seem to offer sub-level menus.
I understand this could be quite heavy in terms of development (new properties to existing objects, new objects, probably some side effects I did not think of, ...).
Do you think it's something that could be doable in the future or did you already thought about it and dropped it for some reason ?
Thanks !