]> granicus.if.org Git - python/commitdiff
Close issue6549: minor ttk.Style fixes
authorEthan Furman <ethan@stoneleaf.us>
Tue, 21 Jul 2015 07:54:19 +0000 (00:54 -0700)
committerEthan Furman <ethan@stoneleaf.us>
Tue, 21 Jul 2015 07:54:19 +0000 (00:54 -0700)
Lib/tkinter/ttk.py
Misc/NEWS

index b9c57ad70401fbcb1892ddf1f7db41971f802c44..bad9596d129a69bd31b9942bf2988344640b1365 100644 (file)
@@ -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):
index 9c5c65bc63c24372f61ab3c68b9fb820c38d4339..960798ee24865228e3a6a34b7d6b54cd6b72c809 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -61,6 +61,9 @@ Library
 - 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?
 ==================================