bpo-45160: Ttk optionmenu only set variable once (GH-28291) (GH-29131)
(cherry picked from commit add46f84769a7e6fafa50954f79b7c248231fa4e)
Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py
index b854235..acdd565 100644
--- a/Lib/tkinter/ttk.py
+++ b/Lib/tkinter/ttk.py
@@ -1643,7 +1643,10 @@ def set_menu(self, default=None, *values):
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: