Issue #15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always

returns bool.  tkinter.BooleanVar now validates input values (accepted bool,
int, str, and Tcl_Obj).  tkinter.BooleanVar.get() now always returns bool.
This commit is contained in:
Serhiy Storchaka 2015-04-04 12:44:30 +03:00
commit 06e66108c6
6 changed files with 58 additions and 17 deletions

View file

@ -391,6 +391,11 @@ class BooleanVar(Variable):
"""
Variable.__init__(self, master, value, name)
def set(self, value):
"""Set the variable to VALUE."""
return self._tk.globalsetvar(self._name, self._tk.getboolean(value))
initialize = set
def get(self):
"""Return the value of the variable as a bool."""
try: