Replies: 1 comment
-
We are no longer using magic comment directives for menus, pursuant to Principle 1: Code is always the best solution. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We need to decide how to specify nested menus when using the new automatic, comment-directive-based approach for toolbars and menubars.
Proposal 1: Children specify their parents
For example:
If the parent exists (for example, if there was an actionable File button), they are added to that parent. If the parent does not exist, it creates an artificial parent, a File button that doesn't do anything but contain the children.
You can also have nested parents:
If you have nested parents, it will follow the same rules as above; it will create as few artificial parents as possible (so if there is an actionable File/Export button, it will use that), but it will create as many artificial parents as needed (like os.MkdirAll). For example, in the export example above, assuming there were no other functions, it would create an artificial File menu button, and then it would create an artificial Export button inside of the File menu, and then it would create the real buttons inside of that
Pros:
/
Cons:
Proposal 2: Parents specify their children
For example:
For every sub-menu group you want, you must declare a container function. If this container function is not actionable itself, then it must be marked with
-container
. You then list out the submenus on the container function.This also supports nested parents:
You must create each container parent yourself.
Pros:
Cons:
Beta Was this translation helpful? Give feedback.
All reactions