mirror of
https://github.com/python/cpython.git
synced 2025-10-20 00:13:47 +00:00
gh-130482: Add ability to specify name for tkinter.OptionMenu and tkinter.ttk.OptionMenu (GH-130502)
This commit is contained in:
parent
1e9cc3d502
commit
e490c00dac
6 changed files with 19 additions and 2 deletions
|
@ -354,6 +354,11 @@ def test_bad_kwarg(self):
|
|||
with self.assertRaisesRegex(TclError, r"^unknown option -image$"):
|
||||
tkinter.OptionMenu(self.root, None, 'b', image='')
|
||||
|
||||
def test_specify_name(self):
|
||||
widget = tkinter.OptionMenu(self.root, None, ':)', name="option_menu")
|
||||
self.assertEqual(str(widget), ".option_menu")
|
||||
self.assertIs(self.root.children["option_menu"], widget)
|
||||
|
||||
@add_configure_tests(IntegerSizeTests, StandardOptionsTests)
|
||||
class EntryTest(AbstractWidgetTest, unittest.TestCase):
|
||||
_rounds_pixels = (tk_version < (9, 0))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue