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:
Serhiy Storchaka 2016-10-30 18:49:52 +02:00
parent 0438683939
commit 32c0d3ada5
4 changed files with 25 additions and 9 deletions

View file

@ -167,15 +167,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):