diff options
author | Zhikang Yan <2951256653@qq.com> | 2025-05-02 19:38:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-02 14:38:50 +0300 |
commit | e490c00dac16d458bb66ad157fda2edd0a2d0a14 (patch) | |
tree | a98e0adb19341bd0abf7ebd41ce492f8ac207fdf /Lib/tkinter/ttk.py | |
parent | 1e9cc3d502773d2dd3b420ecf5b949d902e010c3 (diff) | |
download | cpython-e490c00dac16d458bb66ad157fda2edd0a2d0a14.tar.gz cpython-e490c00dac16d458bb66ad157fda2edd0a2d0a14.zip |
gh-130482: Add ability to specify name for tkinter.OptionMenu and tkinter.ttk.OptionMenu (GH-130502)
Diffstat (limited to 'Lib/tkinter/ttk.py')
-rw-r--r-- | Lib/tkinter/ttk.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py index 8ddb7f97e3b..c0cf1e787fa 100644 --- a/Lib/tkinter/ttk.py +++ b/Lib/tkinter/ttk.py @@ -1603,7 +1603,8 @@ class OptionMenu(Menubutton): A callback that will be invoked after selecting an item. """ kw = {'textvariable': variable, 'style': kwargs.pop('style', None), - 'direction': kwargs.pop('direction', None)} + 'direction': kwargs.pop('direction', None), + 'name': kwargs.pop('name', None)} Menubutton.__init__(self, master, **kw) self['menu'] = tkinter.Menu(self, tearoff=False) |