mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +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:
parent
0438683939
commit
32c0d3ada5
4 changed files with 25 additions and 9 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue