Skip to content

gh-101284: Allow passing Menubutton options to tkinter.OptionMenu#151959

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:tkinter-optionmenu-options
Jun 23, 2026
Merged

gh-101284: Allow passing Menubutton options to tkinter.OptionMenu#151959
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:tkinter-optionmenu-options

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

tkinter.OptionMenu now forwards arbitrary keyword arguments to the underlying Menubutton instead of rejecting all but command and name.
They can also override OptionMenu's default appearance options (borderwidth, relief, anchor, etc.), whose values are otherwise kept.

The positional variable/value/*values API is unchanged, so this is backward compatible.
Unknown options are now reported by Tk itself (unknown option "-spam") rather than by a hand-rolled message.

Arbitrary keyword arguments are now forwarded to the underlying
Menubutton and can override OptionMenu's default appearance options.
The positional API is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33263197 | 📁 Comparing 575a0fe against main (3f09a17)

  🔍 Preview build  

3 files changed
± library/tkinter.html
± whatsnew/3.16.html
± whatsnew/changelog.html

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) June 23, 2026 06:11
@serhiy-storchaka serhiy-storchaka merged commit 868d9a8 into python:main Jun 23, 2026
95 of 97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant