diff options
author | csabella <cheryl.sabella@gmail.com> | 2017-07-31 19:10:13 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-07-31 19:10:13 (GMT) |
commit | 2bf1586e60a6639b532cd8e3442ae33064523eb1 (patch) | |
tree | aa0964860c85cfc49a6b378500eb7a19b225b27c /Lib/tkinter/test/test_ttk | |
parent | 8c4e5be1dfb4d1c74e8cc7ac925e3196818e07ac (diff) | |
download | cpython-2bf1586e60a6639b532cd8e3442ae33064523eb1.zip cpython-2bf1586e60a6639b532cd8e3442ae33064523eb1.tar.gz cpython-2bf1586e60a6639b532cd8e3442ae33064523eb1.tar.bz2 |
[3.6] bpo-25684: ttk.OptionMenu radiobuttons weren't unique (GH-2276) (#2959)
between instances of OptionMenu.
(cherry picked from commit a568e5273382a5dca0c27274f7d8e34c41a87d4d)
* Update Misc/ACKS
Diffstat (limited to 'Lib/tkinter/test/test_ttk')
-rw-r--r-- | Lib/tkinter/test/test_ttk/test_extensions.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/tkinter/test/test_ttk/test_extensions.py b/Lib/tkinter/test/test_ttk/test_extensions.py index 218b27f..a45f882 100644 --- a/Lib/tkinter/test/test_ttk/test_extensions.py +++ b/Lib/tkinter/test/test_ttk/test_extensions.py @@ -291,6 +291,31 @@ class OptionMenuTest(AbstractTkTest, unittest.TestCase): optmenu.destroy() + def test_unique_radiobuttons(self): + # check that radiobuttons are unique across instances (bpo25684) + items = ('a', 'b', 'c') + default = 'a' + optmenu = ttk.OptionMenu(self.root, self.textvar, default, *items) + textvar2 = tkinter.StringVar(self.root) + optmenu2 = ttk.OptionMenu(self.root, textvar2, default, *items) + optmenu.pack() + optmenu.wait_visibility() + optmenu2.pack() + optmenu2.wait_visibility() + optmenu['menu'].invoke(1) + optmenu2['menu'].invoke(2) + optmenu_stringvar_name = optmenu['menu'].entrycget(0, 'variable') + optmenu2_stringvar_name = optmenu2['menu'].entrycget(0, 'variable') + self.assertNotEqual(optmenu_stringvar_name, + optmenu2_stringvar_name) + self.assertEqual(self.root.tk.globalgetvar(optmenu_stringvar_name), + items[1]) + self.assertEqual(self.root.tk.globalgetvar(optmenu2_stringvar_name), + items[2]) + + optmenu.destroy() + optmenu2.destroy() + tests_gui = (LabeledScaleTest, OptionMenuTest) |