-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify MenuBar arguments. #390
Comments
I can see the benefit of using a dictionary for the menubar description. Note: - the change would need to be compatible with previous versions. |
If you haven't seen already I've worked on this a bit in pull request #391 My code hopefully makes it backwards compatible. The tests use positional arguments as they are most likely to break. The actual change to the dictionary was only very small, minor adjustment to the exising code, most of it is the backwards-compatibility :P |
I included this for review in v1.3.0 but after looking at the MenuBar code base I think a refactor should be considered and am pushing back. I like the idea of using a dict to set options, its seems more intuitive. I think additional methods should also be added to create menu items in real time. |
The current way the MenuBar constructor is set out is a bit messy and can be hard to manage.
So I propose it is changed from lists, to dictionaries in one argument rather than two.
Rather than this:
it could be like this:
(I was unsure what to call the argument,
menu
might not be a good name for it.)As the
toplevel
values are essentially keys to theoption
lists anyways,and having a a key and function makes more sense than a list with the name and function in my opinion.
The old way should probably be kept in order to not break existing things.
The text was updated successfully, but these errors were encountered: