From ad1a34197e0d4b890776b8490853d6b9ee38934a Mon Sep 17 00:00:00 2001 From: Ethan Furman Date: Tue, 21 Jul 2015 00:54:19 -0700 Subject: [PATCH] Close issue6549: minor ttk.Style fixes --- 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 index b9c57ad704..bad9596d12 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): diff --git a/Misc/NEWS b/Misc/NEWS index 9c5c65bc63..960798ee24 100644 --- 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? ================================== -- 2.40.0