summaryrefslogtreecommitdiffstats
path: root/Lib/lib-tk/Tkinter.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/lib-tk/Tkinter.py')
-rw-r--r--Lib/lib-tk/Tkinter.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index de41bdc..bd80c3b 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -234,6 +234,12 @@ class IntVar(Variable):
MASTER can be given as master widget."""
Variable.__init__(self, master)
+ def set(self, value):
+ """Set the variable to value, converting booleans to integers."""
+ if isinstance(value, bool):
+ value = int(value)
+ return Variable.set(self, value)
+
def get(self):
"""Return the value of the variable as an integer."""
return getint(self._tk.globalgetvar(self._name))