Skip to content
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

Adding default value as None for tk.OptionMenu positional arguments in order to follow standards and get default non-parameterized widget #130356

Open
kurawlefaraaz opened this issue Feb 20, 2025 · 0 comments
Labels
stdlib Python modules in the Lib dir topic-tkinter type-feature A feature request or enhancement

Comments

@kurawlefaraaz
Copy link

kurawlefaraaz commented Feb 20, 2025

Feature or enhancement

Proposal:

In current implementation of .__init__ of tk.OptionMenu, tkinter raise's error if we use

tk.OptionMenu() # Argument missing error

while other widgets like tk.Button work without arguments

 tk.Button() # No Error

Therefore by making the below change, tkinter can follow its standard among other widget as well as get user get a non-parameterized OptionMenu widget.

Change:

def __init__(self, master, variable, value, *values, **kwargs): #Line 4020 in cpython/Lib/tkinter /__init__.py

To:

def __init__(self, master=None, variable=None, value=None, *values, **kwargs): #Line 4020 in cpython/Lib/tkinter /__init__.py

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

@kurawlefaraaz kurawlefaraaz added the type-feature A feature request or enhancement label Feb 20, 2025
@encukou encukou added stdlib Python modules in the Lib dir topic-tkinter labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-tkinter type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants