summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/ttk.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-04-04 09:43:01 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-04-04 09:43:01 (GMT)
commit9a6e201f7d5f147b776274c1598089fc68859e98 (patch)
treee0daed0ebec9426b48936bb37e2dc91ef74e0c79 /Lib/tkinter/ttk.py
parentc9ba38c21c9a7ba9e26cdfaee7f6e201f561222e (diff)
downloadcpython-9a6e201f7d5f147b776274c1598089fc68859e98.zip
cpython-9a6e201f7d5f147b776274c1598089fc68859e98.tar.gz
cpython-9a6e201f7d5f147b776274c1598089fc68859e98.tar.bz2
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.
Diffstat (limited to 'Lib/tkinter/ttk.py')
-rw-r--r--Lib/tkinter/ttk.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py
index 4327dbb..b9c57ad 100644
--- a/Lib/tkinter/ttk.py
+++ b/Lib/tkinter/ttk.py
@@ -573,7 +573,7 @@ class Widget(tkinter.Widget):
if ret and callback:
return callback(*args, **kw)
- return bool(ret)
+ return ret
def state(self, statespec=None):
@@ -681,7 +681,7 @@ class Entry(Widget, tkinter.Entry):
"""Force revalidation, independent of the conditions specified
by the validate option. Returns False if validation fails, True
if it succeeds. Sets or clears the invalid state accordingly."""
- return bool(self.tk.getboolean(self.tk.call(self._w, "validate")))
+ return self.tk.getboolean(self.tk.call(self._w, "validate"))
class Combobox(Entry):
@@ -1231,7 +1231,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
def exists(self, item):
"""Returns True if the specified item is present in the tree,
False otherwise."""
- return bool(self.tk.getboolean(self.tk.call(self._w, "exists", item)))
+ return self.tk.getboolean(self.tk.call(self._w, "exists", item))
def focus(self, item=None):