summaryrefslogtreecommitdiff
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-02-10 05:44:56 +0000
committerMartin Panter <vadmium+py@gmail.com>2016-02-10 05:44:56 +0000
commit57204f59111a6407ce6503e80c646ab96f8f2aa3 (patch)
tree18898b1cb4246d6de9a881f6bbf9083cc01df6db /Lib/tkinter
parent4e214c5025aeeeb69562dd0c46ae0918881d0bae (diff)
parentcc3ba16af422a2ba6fd25d83e8c21e327dbf7a0d (diff)
downloadcpython-57204f59111a6407ce6503e80c646ab96f8f2aa3.tar.gz
Issue #26304: Merge doc wording from 3.5
Diffstat (limited to 'Lib/tkinter')
-rw-r--r--Lib/tkinter/__init__.py3
-rw-r--r--Lib/tkinter/test/test_tkinter/test_widgets.py7
-rw-r--r--Lib/tkinter/ttk.py10
3 files changed, 12 insertions, 8 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index 4e642c6fc3..eaf7af844f 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -845,8 +845,7 @@ class Misc:
self.tk.call('winfo', 'height', self._w))
def winfo_id(self):
"""Return identifier ID for this widget."""
- return self.tk.getint(
- self.tk.call('winfo', 'id', self._w))
+ return int(self.tk.call('winfo', 'id', self._w), 0)
def winfo_interps(self, displayof=0):
"""Return the name of all Tcl interpreters for this display."""
args = ('winfo', 'interps') + self._displayof(displayof)
diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py
index 7171667cc8..5a01a5a2d8 100644
--- a/Lib/tkinter/test/test_tkinter/test_widgets.py
+++ b/Lib/tkinter/test/test_tkinter/test_widgets.py
@@ -91,9 +91,10 @@ class ToplevelTest(AbstractToplevelTest, unittest.TestCase):
widget = self.create()
self.assertEqual(widget['use'], '')
parent = self.create(container=True)
- wid = parent.winfo_id()
- widget2 = self.create(use=wid)
- self.assertEqual(int(widget2['use']), wid)
+ wid = hex(parent.winfo_id())
+ with self.subTest(wid=wid):
+ widget2 = self.create(use=wid)
+ self.assertEqual(widget2['use'], wid)
@add_standard_options(StandardOptionsTests)
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py
index 244fb3dd74..b72c0904b2 100644
--- a/Lib/tkinter/ttk.py
+++ b/Lib/tkinter/ttk.py
@@ -381,7 +381,9 @@ class Style(object):
a sequence identifying the value for that option."""
if query_opt is not None:
kw[query_opt] = None
- return _val_or_dict(self.tk, kw, self._name, "configure", style)
+ result = _val_or_dict(self.tk, kw, self._name, "configure", style)
+ if result or query_opt:
+ return result
def map(self, style, query_opt=None, **kw):
@@ -466,12 +468,14 @@ class Style(object):
def element_names(self):
"""Returns the list of elements defined in the current theme."""
- return self.tk.splitlist(self.tk.call(self._name, "element", "names"))
+ return tuple(n.lstrip('-') for n in self.tk.splitlist(
+ self.tk.call(self._name, "element", "names")))
def element_options(self, elementname):
"""Return the list of elementname's options."""
- return self.tk.splitlist(self.tk.call(self._name, "element", "options", elementname))
+ return tuple(o.lstrip('-') for o in self.tk.splitlist(
+ self.tk.call(self._name, "element", "options", elementname)))
def theme_create(self, themename, parent=None, settings=None):