[New-bugs-announce] [issue25684] ttk.OptionMenu radiobuttons aren't unique between two instances of OptionMenu

Bryan Oakley report at bugs.python.org
Fri Nov 20 12:24:48 EST 2015


New submission from Bryan Oakley:

Original issue was brought to my attention by this SO question: http://stackoverflow.com/questions/33831289/ttk-optionmenu-displaying-check-mark-on-all-menus

The ttk.OptionMenu uses radiobuttons for the dropdown menu. However, because it doesn't set the `variable` attribute, they all get the default. If you have two or more OptionMenu instances, all of the radiobuttons are tied together. If you select the first item in the first OptionMenu, and the second item in the second OptionMenu, the dropdown menu for both will show the second item checked.

The solution is to add `variable=self._variable` when creating the menu radiobutton items.

----------
components: Tkinter
messages: 255001
nosy: Bryan.Oakley
priority: normal
severity: normal
status: open
title: ttk.OptionMenu radiobuttons aren't unique between two instances of OptionMenu
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25684>
_______________________________________


More information about the New-bugs-announce mailing list