mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused
by representing the scale as float value internally in Tk. tkinter.IntVar now works if float value is set to underlying Tk variable.
This commit is contained in:
commit
016a9acb26
4 changed files with 25 additions and 9 deletions
|
@ -217,15 +217,14 @@ class TestIntVar(TestBase):
|
|||
self.assertEqual(123, v.get())
|
||||
self.root.globalsetvar("name", "345")
|
||||
self.assertEqual(345, v.get())
|
||||
self.root.globalsetvar("name", "876.5")
|
||||
self.assertEqual(876, v.get())
|
||||
|
||||
def test_invalid_value(self):
|
||||
v = IntVar(self.root, name="name")
|
||||
self.root.globalsetvar("name", "value")
|
||||
with self.assertRaises((ValueError, TclError)):
|
||||
v.get()
|
||||
self.root.globalsetvar("name", "345.0")
|
||||
with self.assertRaises((ValueError, TclError)):
|
||||
v.get()
|
||||
|
||||
|
||||
class TestDoubleVar(TestBase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue