[Python-checkins] cpython: Close issue6549: minor ttk.Style fixes

ethan.furman python-checkins at python.org
Tue Jul 21 09:55:17 CEST 2015


https://hg.python.org/cpython/rev/c3fa46d85857
changeset:   96976:c3fa46d85857
user:        Ethan Furman <ethan at stoneleaf.us>
date:        Tue Jul 21 00:54:19 2015 -0700
summary:
  Close issue6549: minor ttk.Style fixes

files:
  Lib/tkinter/ttk.py |  10 +++++++---
  Misc/NEWS          |   3 +++
  2 files changed, 10 insertions(+), 3 deletions(-)


diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py
--- a/Lib/tkinter/ttk.py
+++ b/Lib/tkinter/ttk.py
@@ -381,7 +381,9 @@
         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 @@
 
     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):
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -61,6 +61,9 @@
 - Issue #15014: SMTP.auth() and SMTP.login() now support RFC 4954's optional
   initial-response argument to the SMTP AUTH command.
 
+- Issue #6549: Remove hyphen from ttk.Style().element options.  Only return result
+  from ttk.Style().configure if a result was generated or a query submitted.
+
 
 What's New in Python 3.5.0 beta 3?
 ==================================

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list