summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/ttk.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-10-21 20:59:20 (GMT)
committerGitHub <noreply@github.com>2021-10-21 20:59:20 (GMT)
commit04485ac9886cd807aae854fb905a88c791cfdde6 (patch)
treea542c07d6bb9c455b46693d6449deec5d05541f6 /Lib/tkinter/ttk.py
parente628700dbf2c3376502cbb5a9bff2d58d1102e16 (diff)
downloadcpython-04485ac9886cd807aae854fb905a88c791cfdde6.zip
cpython-04485ac9886cd807aae854fb905a88c791cfdde6.tar.gz
cpython-04485ac9886cd807aae854fb905a88c791cfdde6.tar.bz2
bpo-45160: Ttk optionmenu only set variable once (GH-28291) (GH-29132)
(cherry picked from commit add46f84769a7e6fafa50954f79b7c248231fa4e) Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
Diffstat (limited to 'Lib/tkinter/ttk.py')
-rw-r--r--Lib/tkinter/ttk.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py
index ab7aeb1..9b58497 100644
--- a/Lib/tkinter/ttk.py
+++ b/Lib/tkinter/ttk.py
@@ -1643,7 +1643,10 @@ class OptionMenu(Menubutton):
menu.delete(0, 'end')
for val in values:
menu.add_radiobutton(label=val,
- command=tkinter._setit(self._variable, val, self._callback),
+ command=(
+ None if self._callback is None
+ else lambda val=val: self._callback(val)
+ ),
variable=self._variable)
if default: